Commit 85d9af49 by kevcha

Remove attr_protected related specs (was removed in rails 4)

parent 4b5a364a
...@@ -123,33 +123,6 @@ describe Paperclip do ...@@ -123,33 +123,6 @@ describe Paperclip do
end end
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 context "with a subclass" do
before do before do
class ::SubDummy < Dummy; end class ::SubDummy < Dummy; end
......
...@@ -37,7 +37,6 @@ RSpec.configure do |config| ...@@ -37,7 +37,6 @@ RSpec.configure do |config|
config.include ModelReconstruction config.include ModelReconstruction
config.include TestData config.include TestData
config.extend VersionHelper config.extend VersionHelper
config.extend RailsHelpers::ClassMethods
config.mock_framework = :mocha config.mock_framework = :mocha
config.before(:all) do config.before(:all) do
rebuild_model 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