melonhead901 / lab-specimen-transport-system

Automatically exported from code.google.com/p/lab-specimen-transport-system
0 stars 0 forks source link

A item without required fields can be added to the database #81

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.click "Add New"
2.select "Item type" "Specimen"
3.click "Update"

What is the expected output? What do you see instead?
I expected that the result shows "Please add the destination, color or 
Transport conditions of the item", but the item was just added to the database.

What version of the product are you using? On what operating system?
Current Website. On Linux.

Please provide any additional information below.

Original issue reported on code.google.com by bestal...@gmail.com on 18 May 2011 at 2:31

GoogleCodeExporter commented 8 years ago
I am going to start validating destination (and source) in my major checkin

Original comment by donovanh...@gmail.com on 18 May 2011 at 5:11

GoogleCodeExporter commented 8 years ago

Original comment by donovanh...@gmail.com on 18 May 2011 at 5:11

GoogleCodeExporter commented 8 years ago
Almost fixed, will need to figure out how to verify that required item 
attributes (transport condition, color, etc) have been set.

Original comment by donovanh...@gmail.com on 18 May 2011 at 8:00

GoogleCodeExporter commented 8 years ago
Use the ItemAttributeSet.required field for validation

Original comment by donovanh...@gmail.com on 18 May 2011 at 8:08

GoogleCodeExporter commented 8 years ago
I'm not sure what ItemAttributeSet.required is...

validates_presence_of :location

should be all you need in the Location model.
If that doesn't work, it's probably a controller or view issue that should be 
fixed.

Original comment by stein.za...@gmail.com on 18 May 2011 at 11:16

GoogleCodeExporter commented 8 years ago
Forget that last comment - I didn't realize there was a required field so I got 
confused.

Original comment by stein.za...@gmail.com on 18 May 2011 at 5:27

GoogleCodeExporter commented 8 years ago
Fixed this.  Will need to update test fixtures so that the ItemAttributeSets 
have the correct required values (Colors and Transport Conditions should both 
be required)

Original comment by donovanh...@gmail.com on 20 May 2011 at 8:22

GoogleCodeExporter commented 8 years ago
Could you verify this and update the test fixtures?

Original comment by donovanh...@gmail.com on 20 May 2011 at 8:37

GoogleCodeExporter commented 8 years ago
What parts need to be updated in the text fixtures? I think all the fixtures 
meet the field requirements, unless I'm missing something...

Original comment by liu.al...@gmail.com on 24 May 2011 at 12:28

GoogleCodeExporter commented 8 years ago
Test fixtures all match up, requirements work. Verified.

Original comment by liu.al...@gmail.com on 26 May 2011 at 10:04