Commit 63520abf authored by charlie ablett's avatar charlie ablett

Merge branch 'ajk-mark-as-spam' into 'master'

Fix bug in snippets mark as spam mutation

See merge request gitlab-org/gitlab!49912
parents 9eae6b36 d759c221
......@@ -23,7 +23,7 @@ module Mutations
private
def mark_as_spam(snippet)
Spam::MarkAsSpamService.new(spammable: snippet).execute
Spam::MarkAsSpamService.new(target: snippet).execute
end
def authorized_resource?(snippet)
......
---
title: Fix bug in snippets mark as spam mutation
merge_request: 49912
author:
type: fixed
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'Mark snippet as spam' do
include GraphqlHelpers
include AfterNextHelpers
let_it_be(:admin) { create(:admin) }
let_it_be(:other_user) { create(:user) }
......@@ -56,11 +57,12 @@ RSpec.describe 'Mark snippet as spam' do
end
it 'marks snippet as spam' do
expect_next_instance_of(Spam::MarkAsSpamService) do |instance|
expect(instance).to receive(:execute)
end
expect_next(Spam::MarkAsSpamService, target: snippet)
.to receive(:execute).and_return(true)
post_graphql_mutation(mutation, current_user: current_user)
expect(graphql_errors).to be_blank
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment