summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-04-12 15:43:29 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-04-12 15:43:29 +0200
commitdc39c8372d760eceba50a35505dad8663b9e851e (patch)
treef4fbba5d35ea707d430b624a9f63c84649c5211f /spec
parent49484f9a2c2efb670f044028c555f00378484dd4 (diff)
downloadgitlab-ce-dc39c8372d760eceba50a35505dad8663b9e851e.tar.gz
Adapt tests to new testing guidelines
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/notes_spec.rb12
-rw-r--r--spec/services/notes/delete_service_spec.rb9
2 files changed, 10 insertions, 11 deletions
diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb
index b35e67b5bd3..a467bc935af 100644
--- a/spec/requests/api/notes_spec.rb
+++ b/spec/requests/api/notes_spec.rb
@@ -243,7 +243,7 @@ describe API::API, api: true do
describe 'DELETE /projects/:id/noteable/:noteable_id/notes/:note_id' do
context 'when noteable is an Issue' do
- it 'should delete a note' do
+ it 'deletes a note' do
delete api("/projects/#{project.id}/issues/#{issue.id}/"\
"notes/#{issue_note.id}", user)
@@ -254,7 +254,7 @@ describe API::API, api: true do
expect(response.status).to eq(404)
end
- it 'should return a 404 error when note id not found' do
+ it 'returns a 404 error when note id not found' do
delete api("/projects/#{project.id}/issues/#{issue.id}/notes/123", user)
expect(response.status).to eq(404)
@@ -262,7 +262,7 @@ describe API::API, api: true do
end
context 'when noteable is a Snippet' do
- it 'should delete a note' do
+ it 'deletes a note' do
delete api("/projects/#{project.id}/snippets/#{snippet.id}/"\
"notes/#{snippet_note.id}", user)
@@ -273,7 +273,7 @@ describe API::API, api: true do
expect(response.status).to eq(404)
end
- it 'should return a 404 error when note id not found' do
+ it 'returns a 404 error when note id not found' do
delete api("/projects/#{project.id}/snippets/#{snippet.id}/"\
"notes/123", user)
@@ -282,7 +282,7 @@ describe API::API, api: true do
end
context 'when noteable is a Merge Request' do
- it 'should delete a note' do
+ it 'deletes a note' do
delete api("/projects/#{project.id}/merge_requests/"\
"#{merge_request.id}/notes/#{merge_request_note.id}", user)
@@ -293,7 +293,7 @@ describe API::API, api: true do
expect(response.status).to eq(404)
end
- it 'should return a 404 error when note id not found' do
+ it 'returns a 404 error when note id not found' do
delete api("/projects/#{project.id}/merge_requests/"\
"#{merge_request.id}/notes/123", user)
diff --git a/spec/services/notes/delete_service_spec.rb b/spec/services/notes/delete_service_spec.rb
index 07aa57c4642..1d0a747a480 100644
--- a/spec/services/notes/delete_service_spec.rb
+++ b/spec/services/notes/delete_service_spec.rb
@@ -1,13 +1,12 @@
require 'spec_helper'
describe Notes::DeleteService, services: true do
- let(:project) { create(:empty_project) }
- let(:issue) { create(:issue, project: project) }
- let(:note) { create(:note, project: project, noteable: issue) }
-
describe '#execute' do
it 'deletes a note' do
- project = note.project
+ project = create(:empty_project)
+ issue = create(:issue, project: project)
+ note = create(:note, project: project, noteable: issue)
+
described_class.new(project, note.author).execute(note)
expect(project.issues.find(issue.id).notes).not_to include(note)