Ruby on Rails
Monday, February 2, 2015
I put this in my test.rb file and it seems to have fixed the problem:
-- # from: https://www.relishapp.com/rspec/rspec-rails/docs/upgrade
On Friday, January 30, 2015 at 1:03:13 PM UTC-5, Sean Kelley wrote:
config.active_record.maintain_test_schema = false
I also commented out any pending migration checks in my rails_helper file
On Friday, January 30, 2015 at 1:03:13 PM UTC-5, Sean Kelley wrote:
If I run:bundle exec rake db:drop db:create db:migrateI get error that db:migrate needs to be run with RAILS_ENV=testif Ibundle exec rake db:drop db:create db:migrate RAILS_ENV=testI get error regarding duplicate table againIf I delete db from postgres management screen then runbundle exec rake db:drop db:create db:migrate RAILS_ENV=testI can again run the test once, but the second time I get the error that migrations are pending and to run db:migrate RAILS_ENV=test
I wonder why the act of running a simple test trigges this migration message
On Friday, January 30, 2015 at 9:41:26 AM UTC-5, Colin Law wrote:On 30 January 2015 at 14:17, Sean Kelley <kelle...@gmail.com> wrote:
>
> Thanks. Your command line affects development db also which is not ideal. I looked up db:test:prepare and it appears to be deprecated in 4.2
> http://stackoverflow.com/questions/15169894/what-does- rake-dbtestprepare-actually-do
>
> I decided to try it anyway with RAILS_ENV=test but I get same error of duplicate table 'users' so I tried without the test env set and I get db connection is closed message for test.
I presume your development db is up to date (so running migrate on
that does nothing).
What happens if you recreate the test db and then run migrate on it?
Does the migrate run successfully?
Colin
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/30065f3c-0179-4954-8fd4-1b8c86d8dbdf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment