I see different results when running 'rake test' and when running 'rake
test:integration'.

When running all tests with 'rake test' all tests pass.
When running 'rake test:integration' I have a failed test because my
model fails to validate inclusion of an attribute before saving.

My model looks something like:

  class Order < ActiveRecord::Base
    belongs_to :payment_type
    validates :payment_type, :inclusion => PaymentType.all
    ...
  end


PaymentType is a lookup table, which I have a fixture for.

When debugging the save method in the Order model I see that it fails
the inclusion validation (again, only when running just the integration
tests), but

  PaymentType.all.include?(payment_type)

evaluates to 'true'.

Any ideas why it fails when running only integration tests?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to