rspec-rails ~> 3.2 uses rails_helper fixes #668

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.
This commit is contained in:
Kurtis Rainbolt-Greene 2015-05-23 20:24:23 -05:00
parent 57a514133b
commit 46f97aaad7
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,9 @@
require 'spec_helper'
<% if RSpec::Rails::Version::STRING.match(/\A3\.[^10]/) %>
require 'rails_helper'
<% else %>
require 'spec_helper'
<% end %>
describe <%= class_name %>Decorator do
end