Disable allow_mass_assignment_of tests under Rails 5
The `allow_mass_assignment_of` matcher tests `attr_accessible` and `attr_protected` which was moved to the `protected_attributes` gem in Rails 4. The gem does not work in Rails 5 and neither does the matcher, so there is no need to test it. (We should probably remove the matcher altogether eventually -- Strong Parameters have long replaced `protected_attributes`.)
This commit is contained in:
parent
bbb4075aba
commit
c1a81d4b13
|
@ -30,5 +30,9 @@ module UnitTests
|
|||
def rails_gte_4_2?
|
||||
rails_version >= 4.2
|
||||
end
|
||||
|
||||
def rails_lte_5?
|
||||
rails_version < 5
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'unit_spec_helper'
|
||||
|
||||
describe Shoulda::Matchers::ActiveModel::AllowMassAssignmentOfMatcher, type: :model do
|
||||
if rails_lte_5?
|
||||
context '#description' do
|
||||
context 'without a role' do
|
||||
it 'includes the attribute name' do
|
||||
|
@ -112,4 +113,5 @@ describe Shoulda::Matchers::ActiveModel::AllowMassAssignmentOfMatcher, type: :mo
|
|||
def define_model(name, columns, &block)
|
||||
super(name, columns, whitelist_attributes: false, &block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue