- [:create, :destroy, :restore].each do |action|
- assert capability.cannot? action, ChangesetComment
- end
- end
-
- test "as a moderator with allow_write_api token" do
- token = create(:access_token, :user => create(:moderator_user), :allow_write_api => true)
- capability = ApiCapability.new token
-
- [:create, :destroy, :restore].each do |action|
- assert capability.can? action, ChangesetComment
- end
+ assert ability.can? :create, ChangesetComment
+ assert ability.can? :create, :changeset_comment_visibility
+ assert ability.can? :destroy, :changeset_comment_visibility