Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wpliao1989 committed Jan 2, 2020
1 parent b492b78 commit 9a2ecb0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/model_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ def test_model_security_write_allowed
Authorization.stub :current_user, MockUser.new(:test_role) do
assert(object = TestModelSecurityModel.create)

assert_nothing_raised { object.update_attributes(:attr_2 => 2) }
assert_nothing_raised { object.update(:attr_2 => 2) }
object.reload
assert_equal 2, object.attr_2
object.destroy
Expand Down Expand Up @@ -1441,7 +1441,7 @@ def test_model_security_write_not_allowed_no_privilege

Authorization.current_user = MockUser.new(:test_role_restricted)
assert_raise Authorization::NotAuthorized do
object.update_attributes(:attr_2 => 2)
object.update(:attr_2 => 2)
end
end

Expand Down Expand Up @@ -1471,15 +1471,15 @@ def test_model_security_write_not_allowed_wrong_attribute_value
end
object = TestModelSecurityModel.create
assert_raise Authorization::AttributeAuthorizationError do
object.update_attributes(:attr => 2)
object.update(:attr => 2)
end
object.reload

assert_nothing_raised do
object.update_attributes(:attr_2 => 1)
object.update(:attr_2 => 1)
end
assert_raise Authorization::AttributeAuthorizationError do
object.update_attributes(:attr => 2)
object.update(:attr => 2)
end
end
end
Expand Down Expand Up @@ -1625,7 +1625,7 @@ def test_model_security_with_assoc
Authorization.stub :current_user, test_attr do
assert(object = TestModelSecurityModel.create(:test_attrs => [test_attr]))
assert_nothing_raised do
object.update_attributes(:attr_2 => 2)
object.update(:attr_2 => 2)
end
without_access_control do
object.reload
Expand Down Expand Up @@ -1662,7 +1662,7 @@ def test_model_security_with_update_attrbributes

with_user MockUser.new(:test_role, :branch => test_attr.branch) do
assert_nothing_raised do
test_model.update_attributes(params[:model_data])
test_model.update(params[:model_data])
end
end
without_access_control do
Expand Down

0 comments on commit 9a2ecb0

Please sign in to comment.