Commit 37589f9b by Jon Moss

Merge pull request #2094 from kevcha/remove-rails-3-support

Remove attr_protected related specs (was removed in rails 4)
parents bd016009 85d9af49
......@@ -123,33 +123,6 @@ describe Paperclip do
end
end
if using_protected_attributes?
context "that is attr_protected" do
before do
Dummy.class_eval do
attr_protected :avatar
end
@dummy = Dummy.new
end
it "does not assign the avatar on mass-set" do
@dummy.attributes = { other: "I'm set!",
avatar: @file }
assert_equal "I'm set!", @dummy.other
assert ! @dummy.avatar?
end
it "allows assigment on normal set" do
@dummy.other = "I'm set!"
@dummy.avatar = @file
assert_equal "I'm set!", @dummy.other
assert @dummy.avatar?
end
end
end
context "with a subclass" do
before do
class ::SubDummy < Dummy; end
......
......@@ -37,7 +37,6 @@ RSpec.configure do |config|
config.include ModelReconstruction
config.include TestData
config.extend VersionHelper
config.extend RailsHelpers::ClassMethods
config.mock_framework = :mocha
config.before(:all) do
rebuild_model
......
module RailsHelpers
module ClassMethods
def using_protected_attributes?
ActiveRecord::VERSION::MAJOR < 4
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment