Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

krainboltgreene
Copy link

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.

Kurtis Rainbolt-Greene added 3 commits May 23, 2015 20:24
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.
baberthal added a commit to baberthal/draper that referenced this pull request Aug 25, 2015
Fix Spec spec generator because RSpec no longer prefers monkey-patching.
baberthal added a commit to baberthal/draper that referenced this pull request Aug 27, 2015
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.
baberthal pushed a commit to baberthal/draper that referenced this pull request Aug 27, 2015
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']
@seanlinsley
Copy link
Member

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.

@seanlinsley seanlinsley closed this Jul 9, 2016
@krainboltgreene
Copy link
Author

Thanks for the consideration!

On Sat, Jul 9, 2016, 9:12 AM Sean Linsley [email protected] wrote:

Closed #675 #675.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#675 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAUb2XwelZIta0EBjnpx_cyr0KQzOr2Gks5qT8h4gaJpZM4Em7as
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants