Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb')
-rw-r--r--spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb b/spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb
index 7c10dccdcb9..caa0fa2d437 100644
--- a/spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb
+++ b/spec/controllers/concerns/spammable_actions/akismet_mark_as_spam_action_spec.rb
@@ -7,12 +7,6 @@ RSpec.describe SpammableActions::AkismetMarkAsSpamAction do
controller(ActionController::Base) do
include SpammableActions::AkismetMarkAsSpamAction
-
- private
-
- def spammable_path
- '/fake_spammable_path'
- end
end
let(:spammable_type) { 'SpammableType' }
@@ -22,7 +16,6 @@ RSpec.describe SpammableActions::AkismetMarkAsSpamAction do
before do
allow(Gitlab::Recaptcha).to receive(:load_configurations!) { true }
routes.draw { get 'mark_as_spam' => 'anonymous#mark_as_spam' }
- allow(controller).to receive(:spammable) { spammable }
allow(controller).to receive(:current_user) { double(:current_user, admin?: admin) }
allow(controller).to receive(:current_user).and_return(current_user)
end
@@ -31,6 +24,9 @@ RSpec.describe SpammableActions::AkismetMarkAsSpamAction do
subject { post :mark_as_spam }
before do
+ allow(controller).to receive(:spammable) { spammable }
+ allow(controller).to receive(:spammable_path) { '/fake_spammable_path' }
+
expect_next(Spam::AkismetMarkAsSpamService, target: spammable)
.to receive(:execute).and_return(execute_result)
end
@@ -68,4 +64,16 @@ RSpec.describe SpammableActions::AkismetMarkAsSpamAction do
end
end
end
+
+ describe '#spammable' do
+ it 'raises when unimplemented' do
+ expect { controller.send(:spammable) }.to raise_error(NotImplementedError)
+ end
+ end
+
+ describe '#spammable_path' do
+ it 'raises when unimplemented' do
+ expect { controller.send(:spammable_path) }.to raise_error(NotImplementedError)
+ end
+ end
end