1 # frozen_string_literal: true
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
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"