FactoryGirl doesn't want to create new object in second test when it can create in the first

33 views
Skip to first unread message

Tsvetelina Borisova

unread,
Apr 28, 2012, 1:14:24 PM4/28/12
to factor...@googlegroups.com
Hello, I am using factory_girl with Capybara and cucumber and I have two scenarios. In thi first I have this code in the Given step:    @instance = FactoryGirl.create(:instance,:key=>key)
in the second scenario I have this:     @instance = FactoryGirl.create(:instance,:id=>id,:key=>key)
And even though I can do that: /instances/key/314C00 for the first scenario but in the second when I go to /instances/345346456(that is the id) I get exception telling me that there isn't such object from ActiveRecord. Can someone help me? Why I can create FactoryGirl object in the first scenario but not in the second? Thanks in advance : )
Reply all
Reply to author
Forward
0 new messages