]> git.openstreetmap.org Git - rails.git/blob - test/abilities/moderator_api_ability_test.rb
Merge remote-tracking branch 'upstream/pull/6787'
[rails.git] / test / abilities / moderator_api_ability_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class ModeratorApiAbilityTest < ActiveSupport::TestCase
6   test "Note permissions" do
7     user = create(:moderator_user)
8     scopes = Set.new %w[write_notes]
9     ability = ApiAbility.new user, scopes
10
11     [:index, :create, :comment, :feed, :show, :search, :close, :reopen, :destroy].each do |action|
12       assert ability.can?(action, Note), "should be able to #{action} Notes"
13     end
14   end
15 end