On 2 June 2011 18:25, Mauro <[email protected]> wrote: > On 2 June 2011 17:15, radhames brito <[email protected]> wrote: >> Try posting a bit of the test.log to seed what is happening to the db > > Sorry I've found that the problem is when I run autotest. > If I run rspec individually for every controller they passes. > If I run autotest they don't pass. > For sector controller test I've posted the code, if I run rspec for it passes. > If I run autotest it says: > > SectorsController GET index assigns all sectors as @sectors > Failure/Error: assigns(:sectors).should eq([sector]) > > expected [#<Sector id: 2603, name: "Sector-1", created_at: > "2011-06-02 18:20:15", updated_at: "2011-06-02 18:20:15">] > got [#<Sector id: 2548, name: "Sector-1", created_at: > "2011-06-02 18:19:46", updated_at: "2011-06-02 18:19:46">, #<Sector > id: 2549, name: "Sector-1", created_at: "2011-06-02 18:19:46", > updated_at: "2011-06-02 18:19:46">, #<Sector id: 2550
In the configuration of database_cleaner I've changed DatabaseCleaner.strategy = :transaction to DatabaseCleaner.strategy = :deletion and when I run autotest now the tests pass. I've to use DatabaseCleaner.strategy = :transaction when I run rspec individually for every spec and DatabaseCleaner.strategy = :deletion when I run autotest? -- 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.

