- test "as a normal user with permissionless token" do
- token = create(:oauth_access_token)
- ability = ApiAbility.new token
-
- [:create, :destroy, :restore].each do |action|
- assert ability.cannot? action, ChangesetComment
- end
+ test "as a normal user without scopes" do
+ user = create(:user)
+ scopes = Set.new
+ ability = ApiAbility.new user, scopes
+
+ assert ability.cannot? :create, ChangesetComment
+ assert ability.cannot? :create, :changeset_comment_visibility
+ assert ability.cannot? :destroy, :changeset_comment_visibility