I'm using ActiveRecord and validations in each state like this in my model
state :draft do
end
state :placed do
validates_presence_of :customer_name, :pickup_address
end
These test fail, which is odd...
test "should require minimal fields to be valid when placed" do
# Try transitioning to a state that has 2 validations
booking.place
assert_equal 2, booking.errors.count #This passes, COOL!
assert_not booking.valid? #This fails, BAD :(
end
I'm using ActiveRecord and validations in each state like this in my model
These test fail, which is odd...
Thoughts welcome :)