Very simple spec... @post.user.should == @user Spec fails even though both objects are identical in every way except their object_id. ActiveRecord objects should equal (==) if their id\'s are the s
I\'m testing my Rails application with RSpec, but then I ran into a problem. I want a consistent database, therefore I imposed a constraint that some columns can not be null.
I am using Ruby on Rails 3.0.10, RSpec 2 and FactoryGirl. I have the following scenario: In the models/user_spec.rb file I have
Here is the definition for model user and user_level. A user has many user levels and a user level belongs to a user.
user_type is a column in user model and it has to be :presence => true. It rejects in rspec when passing a nil to use开发者_Go百科r_type. However the factory_girl can store a nil user_type into the fi
The following is the error message running rspec spec: /factory_girl-2.1.0/lib/factory_girl/registry.rb:38:in `add_as\': Already defined: user (FactoryGirl::DuplicateDefinitionError)
I am having a problem with factory_girl. Here is the error with rspec. \"Failure/Error: customer = Factory(:customer, :name => nil)
I can\'t use factory_girl because I\'m testing sunspot and need real database. Edit: nope. It can works with sunspot. I\'m wrong.
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to make has_many :through association with fixtures?
p = Factory(:model) ap Model.find(:all)#output to prove that it\'s getting created so... the print shows that the IDs of the objects is going up.... but the database remains empty as I continually