X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/53817fa9e8d955df0891d156f21b7269b4ed08fc..5047ec403db94b0d371a9a10b56801bc0a3fcf0a:/test/abilities/api_abilities_test.rb diff --git a/test/abilities/api_abilities_test.rb b/test/abilities/api_abilities_test.rb index 8ddc54561..38154174c 100644 --- a/test/abilities/api_abilities_test.rb +++ b/test/abilities/api_abilities_test.rb @@ -7,7 +7,8 @@ end class GuestApiAbilityTest < ApiAbilityTest test "note permissions for a guest" do - ability = ApiAbility.new nil + scopes = Set.new + ability = ApiAbility.new nil, scopes [:index, :create, :feed, :show, :search].each do |action| assert ability.can?(action, Note), "should be able to #{action} Notes" @@ -21,7 +22,9 @@ end class UserApiAbilityTest < ApiAbilityTest test "Note permissions" do - ability = ApiAbility.new create(:user) + user = create(:user) + scopes = Set.new %w[write_notes] + ability = ApiAbility.new user, scopes [:index, :create, :comment, :feed, :show, :search, :close, :reopen].each do |action| assert ability.can?(action, Note), "should be able to #{action} Notes" @@ -35,7 +38,9 @@ end class ModeratorApiAbilityTest < ApiAbilityTest test "Note permissions" do - ability = ApiAbility.new create(:moderator_user) + user = create(:moderator_user) + scopes = Set.new %w[write_notes] + ability = ApiAbility.new user, scopes [:index, :create, :comment, :feed, :show, :search, :close, :reopen, :destroy].each do |action| assert ability.can?(action, Note), "should be able to #{action} Notes"