-
Notifications
You must be signed in to change notification settings - Fork 526
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
rspec-rails ~> 3.2 uses rails_helper fixes #668 #675
Conversation
As of rspec-rails 3.2 they generate two files: - spec/spec_helper.rb - spec/rails_helper.rb This allows the user to either do pure ruby unit tests or include the entire rails environment. Draper really only works in a rails application if it has the rails environment. This matches ~> 3.2 and uses the rails_helper instead of spec_helper.
Fix Spec spec generator because RSpec no longer prefers monkey-patching.
Fix Spec spec generator because RSpec no longer prefers monkey-patching. Refactor PR drapergem#675 to be more concise re RSpec Version check, and to use RSpec::Core::Version rather than RSpec::Rails::Version, because the latter does not exist.
As of rspec-rails 3.3 they generate two files: - spec/spec_helper.rb - spec/rails_helper.rb This allows the user to either do pure ruby unit tests or include the entire rails environment. Draper really only works in a rails application if it has the rails environment. This matches ~> 3.2 and uses the rails_helper instead of spec_helper for the dummy app specs, but the standard spec_helper for the draper specs. Fix Spec spec generator because RSpec no longer prefers monkey-patching. Refactor PR drapergem#675 to be more concise re RSpec Version check, and to use RSpec::Core::Version rather than RSpec::Rails::Version, in case the latter does not exist. Updated all specs to RSpec 3.0 syntax ===================================== Change specs to use synax `expect(OBJECT).to EXPECTATION` rather that `OBJECT.should`. Changed all `OBJECT.stub(METHOD)` to `allow(OBJECT).to receive(:method)` Change one-liners to use syntax: `it { is_expected.to XXX }` rather than `it { should }`. Merge PR drapergem#674 from @mcasper and fix all trivial conflicts (i.e `allow(OBJ).to receive(:message)` vs `allow(OBJ).to receive_messages`) Gitignore ========= Ignore .ruby_version and .ruby_gemset Spec Helper =========== ActiveRecord::Migration.maintain_test_schema! is undefined in Rails 4.0, so I made that method conditional upon ENV['RAILS_VERSION']
As of #752 we're dropping support for older versions of Rails, so this extra conditional logic isn't necessary. Thanks for the PR, regardless. |
Thanks for the consideration! On Sat, Jul 9, 2016, 9:12 AM Sean Linsley [email protected] wrote:
|
As of rspec-rails 3.2 they generate two files:
This allows the user to either do pure ruby unit tests or include the entire rails environment. Draper really only works in a rails application if it has the rails environment. This matches ~> 3.2 and uses the rails_helper instead of spec_helper.