> Hi, I've been trying to work this out for a while, im convinced its
> some local db configuration specific to my machine.
>
> When running `rake spec` 14 of my test fail all of them in the
> user_spec generated by restful auth.
> The error for all the failing tests is:
>
> ActiveRecord::RecordNotFound
> Couldn't find User with ID=1
>
> Iv put some debugger lines and at the start of some of the tests it
> would appear that the users fixture is not being loaded when running
> the full suite
> If I run the specific test with the spec binary `spec spec/modes/
> user_spec.rb` all the fixtures are loaded and pass as expected.
>
> Further more, the error is only apparent when using mysql for the
> test db...
> When I use sqlite for the test db the tests pass when running the
> whole suite and the specific test...
>
> Weird... I'd like to know if anyone else has experienced this and if
> anyone has any pointers as to why the fixtures are not loaded when
> using mysql as the test db.
Gist a copy of your spec_helper.rb
I'd also run rake db:test:prepare and inspect the test database -
making sure the fixtures are getting loaded properly.
Just to note - running ./script/spec <a-spec-file.rb> won't recreate
the test database.
You might also want to inspect that your fixtures are valid with a
project like this (some code I've poached):
http://github.com/smtlaissezfaire/validate_fixtures/tree/master
Scott
>
> Many thanks
> Rob
> _______________________________________________
> rspec-users mailing list
> rspec...@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
config.before(:each) do
Rails.logger.warn "ZipsTerritory.count == #{ZipsTerritory.count}"
end
Example please?
> I've tried several version of FactoryGirl and all of
> those seem to trigger the issue too.
> My spec_helper.rb is: https://gist.github.com/0d3ea01ffe4a15f4b2b3
> Does anything stand out? Has anybody else experienced this? Any ideas?
> Thanks, Doug
I made one comment on the gist, but I think it's unrelated.
You say nothing changed that you _think_ would cause this, but
something must have changes somewhere. What _did_ change? Any new gems
or upgraded gems in the environment?
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users