-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change rails_helper.rb
template to friendly error log
#1924
Change rails_helper.rb
template to friendly error log
#1924
Conversation
008e07b
to
b202560
Compare
👍 |
@koic this looks good to me, I'll write a changelog entry and get it in to the master branch when I get some time. I think this is good to put out in the next minor version of RSpec. |
# If you are not using ActiveRecord, you can remove this line. | ||
ActiveRecord::Migration.maintain_test_schema! | ||
|
||
# If you are not using ActiveRecord, you can remove this lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider: "these lines" or "this block"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it. Thanks!
b202560
to
88e89be
Compare
This commit will change `rails_helper.rb` template to the following pending migration error log. ## Before ```console % bin/rspec spec/models/foo_spec.rb /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/bundler/gems/rails-0f8568f58d36/activerecord/lib/active_record/migration.rb:578:in `check_pending!': (ActiveRecord::PendingMigrationError) Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=test from /Users/koic/src/ (snip) /spec/spec_helper.rb:27:in `<top (required)>' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `require' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `block in requires=' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `each' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `requires=' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `each' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `process_options_into' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:21:in `configure' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:99:in `setup' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:86:in `run' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:71:in `run' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:45:in `invoke' from /Users/koic/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/exe/rspec:4:in `<top (required)>' from bin/rspec:9:in `load' from bin/rspec:9:in `<main>' ``` ## After ```console % bin/rspec spec/models/foo_spec.rb Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=test ``` This PR got an idea from rails/rails#28939.
88e89be
to
372477c
Compare
Thanks ❤️ |
This commit will change
rails_helper.rb
template to the following pending migration error log.Before
After
This PR got an idea from rails/rails#28939.