-
Notifications
You must be signed in to change notification settings - Fork 0
Added feature spec for no barcode purchase #8
base: master
Are you sure you want to change the base?
Conversation
@madisonlemmond Looks like you have a code style/formatting issue. You can see these locally by running:
Here's the error (which you can see by clicking Details on one of the failed builds at the bottom in the merge area or by clicking the red X next to the commit ID above):
If you delete the extra line at 146 (there are 2 empty lines between those 2 tests) |
If you do One caveat -- commit your work before running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're VERY close. What you've created looks great!
See my notes -- there are 2 things that need to be added to ensure we're actually testing what we intend to test.
# form updates | ||
pending "TODO: adding items with a new barcode" | ||
raise | ||
expect(page).to have_xpath("//input[@id='_barcode-lookup-new_line_items']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if the user fills out the form and the barcode info submits, but then it fails to save the barcode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I should test to see if the new barcode item is saved at the end?
expect(page).to have_field "barcode_item_value", with: "0" | ||
# fill that in | ||
fill_in "barcode_item_quantity", with: "10" | ||
select Item.alphabetized.first.name, from: "barcode_item_barcodeable_id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably won't successfully submit a barcode because no barcode value (barcode_item_value
) is set -- you can provide any alphanumeric string (no spaces) and it should accept it.
cc1af53
to
22ab344
Compare
@armahillo ping |
Resolves #4
Description
Added a feature spec to test for when a purchase is entered with a barcode that does not yet exist.
Type of change
How Has This Been Tested?
This issue was to add a test