Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix accessible/protected tests after change to update_attribute

  • Loading branch information...
commit 21ce488ba53d311bd3f75eca4253d433b4a6031c 1 parent 24f5659
@bkeepers bkeepers authored
View
4 test/functional/test_accessible.rb
@@ -68,9 +68,9 @@ class AccessibleTest < Test::Unit::TestCase
doc.name.should == 'John'
end
- should "ignore inaccessible attribute on #update_attribute" do
+ should "not ignore inaccessible attribute on #update_attribute" do
@doc.update_attribute('admin', true)
- @doc.admin.should be_false
+ @doc.admin.should be_true
end
should "ignore inaccessible attribute on #update_attributes" do
View
6 test/functional/test_protected.rb
@@ -76,7 +76,7 @@ class ProtectedTest < Test::Unit::TestCase
should "ignore protected attribute on #update_attribute" do
@doc.update_attribute('admin', true)
- @doc.admin.should be_false
+ @doc.admin.should be_true
end
should "ignore protected attribute on #update_attributes" do
@@ -181,9 +181,9 @@ class ::OtherChild < ::GrandParent
@edoc.admin.should be_true
end
- should "ignore protected attribute on #update_attribute" do
+ should "not ignore protected attribute on #update_attribute" do
@edoc.update_attribute('admin', true)
- @edoc.admin.should be_false
+ @edoc.admin.should be_true
end
should "ignore protected attribute on #update_attributes" do
View
13 test/functional/test_querying.rb
@@ -693,16 +693,11 @@ def setup
end
should "update the attribute without invoking validations" do
- setup do
- @document = Doc do
- key :name, String, :required => true
- end
- end
+ @document.key :name, String, :required => true
- doc = @document.new
- doc.expects(:valid?).never
- doc.update_attribute('name', '').should be_true
- doc.reload.name.should == ''
+ @doc.expects(:valid?).never
+ @doc.update_attribute('name', '').should be_true
+ @doc.reload.name.should == ''
@document.count.should == 1
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.