test/paperclip_test.rb in paperclip-3.5.0 vs test/paperclip_test.rb in paperclip-3.5.1
- old
+ new
@@ -121,31 +121,33 @@
has_attached_file :blah
end
end
end
- context "that is attr_protected" do
- setup do
- Dummy.class_eval do
- attr_protected :avatar
+ if using_protected_attributes?
+ context "that is attr_protected" do
+ setup do
+ Dummy.class_eval do
+ attr_protected :avatar
+ end
+ @dummy = Dummy.new
end
- @dummy = Dummy.new
- end
- should "not assign the avatar on mass-set" do
- @dummy.attributes = { :other => "I'm set!",
- :avatar => @file }
+ should "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
+ assert_equal "I'm set!", @dummy.other
+ assert ! @dummy.avatar?
+ end
- should "still allow assigment on normal set" do
- @dummy.other = "I'm set!"
- @dummy.avatar = @file
+ should "still allow assigment on normal set" do
+ @dummy.other = "I'm set!"
+ @dummy.avatar = @file
- assert_equal "I'm set!", @dummy.other
- assert @dummy.avatar?
+ assert_equal "I'm set!", @dummy.other
+ assert @dummy.avatar?
+ end
end
end
context "with a subclass" do
setup do