- token = create(:oauth_access_token, :user => user, :scopes => %w[write_api])
- ability = ApiAbility.new user, token
-
- [:destroy, :restore].each do |action|
- assert ability.cannot? action, ChangesetComment
- end
+ scopes = Set.new %w[write_changeset_comments]
+ ability = ApiAbility.new user, scopes