summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/issues_controller_spec.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-09 12:43:47 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-08-15 17:20:57 -0500
commit5994c11910822463faeabb7b5f11d6529036db9d (patch)
treea80a8ffea4d4ef868790aab627abfcaa1c982d10 /spec/controllers/projects/issues_controller_spec.rb
parent43e756d4eafd79f4d2f366b646ebb94af78b5a4c (diff)
downloadgitlab-ce-5994c11910822463faeabb7b5f11d6529036db9d.tar.gz
Further refactor and syntax fixes.
Diffstat (limited to 'spec/controllers/projects/issues_controller_spec.rb')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb13
1 files changed, 4 insertions, 9 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 0e8d4b80b0e..0836b71056c 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -274,7 +274,7 @@ describe Projects::IssuesController do
describe 'POST #create' do
context 'Akismet is enabled' do
before do
- allow_any_instance_of(Spammable).to receive(:check_for_spam?).and_return(true)
+ allow_any_instance_of(SpamService).to receive(:check_for_spam?).and_return(true)
allow_any_instance_of(AkismetService).to receive(:is_spam?).and_return(true)
end
@@ -317,7 +317,7 @@ describe Projects::IssuesController do
end
it 'creates a user agent detail' do
- expect{ post_new_issue }.to change(UserAgentDetail, :count)
+ expect{ post_new_issue }.to change(UserAgentDetail, :count).by(1)
end
end
end
@@ -325,9 +325,8 @@ describe Projects::IssuesController do
describe 'POST #mark_as_spam' do
context 'properly submits to Akismet' do
before do
- allow_any_instance_of(AkismetService).to receive_messages(spam!: true)
+ allow_any_instance_of(AkismetService).to receive_messages(submit_spam: true)
allow_any_instance_of(ApplicationSetting).to receive_messages(akismet_enabled: true)
- allow_any_instance_of(SpamService).to receive_messages(can_be_submitted?: true)
end
def post_spam
@@ -342,13 +341,9 @@ describe Projects::IssuesController do
}
end
- it 'creates a system note' do
- expect{ post_spam }.to change(Note, :count)
- end
-
it 'updates issue' do
post_spam
- expect(issue.submitted?).to be_truthy
+ expect(issue.submittable_as_spam?).to be_falsey
end
end
end