Permalink
Browse files

Change some version checks to use ActiveRecord.

This allow using ActiveRecord fixtures without pulling in all of Rails.
  • Loading branch information...
dpogue authored and alindeman committed Aug 9, 2013
1 parent 9764f3d commit 4babeedd50e3e0293d65590833f368d79bd4a8ca
View
@@ -10,6 +10,9 @@ Bug fixes
* Fixes "warning: instance variable @orig\_routes not initialized" raised by
controller specs when `--warnings` are enabled. (Andy Lindeman)
+* Where possible, check against the version of ActiveRecord, rather than
+ Rails. It is possible to use some of rspec-rails without all of Rails.
+ (Darryl Pogue)
### 2.14.0 / 2013-07-06
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
@@ -10,7 +10,7 @@ Feature: errors_on
validates_presence_of :name
# In Rails 4, mass assignment protection is implemented on controllers
- attr_accessible :name if ::Rails::VERSION::STRING < '4'
+ attr_accessible :name if ::ActiveRecord::VERSION::STRING < '4'
validates_length_of :name, :minimum => 10, :on => :publication
end
@@ -10,7 +10,7 @@ module ActiveRecord
# ModelClass.should have(:no).records
# ModelClass.should have(1).record
# ModelClass.should have(n).records
- if ::Rails::VERSION::STRING >= '4'
+ if ::ActiveRecord::VERSION::STRING >= '4'
def records
all.to_a
end
@@ -4,7 +4,7 @@ module Rails
module FixtureSupport
extend ActiveSupport::Concern
include RSpec::Rails::SetupAndTeardownAdapter
- include RSpec::Rails::MiniTestLifecycleAdapter if ::Rails::VERSION::STRING > '4'
+ include RSpec::Rails::MiniTestLifecycleAdapter if ::ActiveRecord::VERSION::STRING > '4'
include RSpec::Rails::TestUnitAssertionAdapter
include ActiveRecord::TestFixtures

0 comments on commit 4babeed

Please sign in to comment.