test/functional/test_protected.rb in mongo_mapper-0.10.1 vs test/functional/test_protected.rb in mongo_mapper-0.11.0

- old
+ new

@@ -72,10 +72,15 @@ doc.reload doc.admin.should be_true doc.name.should == 'John' end + should "ignore protected attribute on #update_attribute" do + @doc.update_attribute('admin', true) + @doc.admin.should be_true + end + should "ignore protected attribute on #update_attributes" do @doc.update_attributes(:name => 'Ren Hoek', :admin => true) @doc.name.should == 'Ren Hoek' @doc.admin.should be_false end @@ -171,9 +176,14 @@ @edoc.protected_attributes.should equal(@edoc_class.protected_attributes) end should "assign protected attribute through accessor" do @edoc.admin = true + @edoc.admin.should be_true + end + + should "not ignore protected attribute on #update_attribute" do + @edoc.update_attribute('admin', true) @edoc.admin.should be_true end should "ignore protected attribute on #update_attributes" do @edoc.update_attributes(:name => 'Ren Hoek', :admin => true)