Commit b44b4d4d authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rs-over-testing' into 'master'

Remove extraneous tests from Issues API spec

Closes #25201

See merge request gitlab-org/gitlab-ce!17222
parents 236dcbcb f23a57b0
require 'spec_helper' require 'spec_helper'
describe API::Issues, :mailer do describe API::Issues do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:project) do set(:project) do
create(:project, :public, creator_id: user.id, namespace: user.namespace) create(:project, :public, creator_id: user.id, namespace: user.namespace)
...@@ -932,18 +932,6 @@ describe API::Issues, :mailer do ...@@ -932,18 +932,6 @@ describe API::Issues, :mailer do
expect(json_response['error']).to eq('confidential is invalid') expect(json_response['error']).to eq('confidential is invalid')
end end
it "sends notifications for subscribers of newly added labels" do
label = project.labels.first
label.toggle_subscription(user2, project)
perform_enqueued_jobs do
post api("/projects/#{project.id}/issues", user),
title: 'new issue', labels: label.title
end
should_email(user2)
end
it "returns a 400 bad request if title not given" do it "returns a 400 bad request if title not given" do
post api("/projects/#{project.id}/issues", user), labels: 'label, label2' post api("/projects/#{project.id}/issues", user), labels: 'label, label2'
expect(response).to have_gitlab_http_status(400) expect(response).to have_gitlab_http_status(400)
...@@ -1246,18 +1234,6 @@ describe API::Issues, :mailer do ...@@ -1246,18 +1234,6 @@ describe API::Issues, :mailer do
expect(json_response['labels']).to eq([label.title]) expect(json_response['labels']).to eq([label.title])
end end
it "sends notifications for subscribers of newly added labels when issue is updated" do
label = create(:label, title: 'foo', color: '#FFAABB', project: project)
label.toggle_subscription(user2, project)
perform_enqueued_jobs do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
title: 'updated title', labels: label.title
end
should_email(user2)
end
it 'removes all labels' do it 'removes all labels' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user), labels: '' put api("/projects/#{project.id}/issues/#{issue.iid}", user), labels: ''
......
require 'spec_helper' require 'spec_helper'
describe API::V3::Issues, :mailer do describe API::V3::Issues do
set(:user) { create(:user) } set(:user) { create(:user) }
set(:user2) { create(:user) } set(:user2) { create(:user) }
set(:non_member) { create(:user) } set(:non_member) { create(:user) }
...@@ -780,18 +780,6 @@ describe API::V3::Issues, :mailer do ...@@ -780,18 +780,6 @@ describe API::V3::Issues, :mailer do
expect(json_response['error']).to eq('confidential is invalid') expect(json_response['error']).to eq('confidential is invalid')
end end
it "sends notifications for subscribers of newly added labels" do
label = project.labels.first
label.toggle_subscription(user2, project)
perform_enqueued_jobs do
post v3_api("/projects/#{project.id}/issues", user),
title: 'new issue', labels: label.title
end
should_email(user2)
end
it "returns a 400 bad request if title not given" do it "returns a 400 bad request if title not given" do
post v3_api("/projects/#{project.id}/issues", user), labels: 'label, label2' post v3_api("/projects/#{project.id}/issues", user), labels: 'label, label2'
...@@ -1045,18 +1033,6 @@ describe API::V3::Issues, :mailer do ...@@ -1045,18 +1033,6 @@ describe API::V3::Issues, :mailer do
expect(json_response['labels']).to eq([label.title]) expect(json_response['labels']).to eq([label.title])
end end
it "sends notifications for subscribers of newly added labels when issue is updated" do
label = create(:label, title: 'foo', color: '#FFAABB', project: project)
label.toggle_subscription(user2, project)
perform_enqueued_jobs do
put v3_api("/projects/#{project.id}/issues/#{issue.id}", user),
title: 'updated title', labels: label.title
end
should_email(user2)
end
it 'removes all labels' do it 'removes all labels' do
put v3_api("/projects/#{project.id}/issues/#{issue.id}", user), labels: '' put v3_api("/projects/#{project.id}/issues/#{issue.id}", user), labels: ''
......
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