Commit 0a1fb9ce authored by Valery Sizov's avatar Valery Sizov

[CE->EE] Fix wrong resolvation of specs

parent 53e98ffd
......@@ -862,36 +862,10 @@ describe Projects::IssuesController do
expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes individual_note])
end
context 'with cross-reference system note', :request_store do
let(:new_issue) { create(:issue) }
let(:cross_reference) { "mentioned in #{new_issue.to_reference(issue.project)}" }
before do
create(:discussion_note_on_issue, :system, noteable: issue, project: issue.project, note: cross_reference)
end
it 'filters notes that the user should not see' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
expect(JSON.parse(response.body).count).to eq(1)
end
it 'does not result in N+1 queries' do
# Instantiate the controller variables to ensure QueryRecorder has an accurate base count
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
RequestStore.clear!
control_count = ActiveRecord::QueryRecorder.new do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
end.count
RequestStore.clear!
create_list(:discussion_note_on_issue, 2, :system, noteable: issue, project: issue.project, note: cross_reference)
it 'filters notes that the user should not see' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
expect { get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid }.not_to exceed_query_limit(control_count)
end
expect(JSON.parse(response.body).count).to eq(1)
end
end
......@@ -953,12 +927,6 @@ describe Projects::IssuesController do
it_behaves_like 'user cannot see confidential issue', Gitlab::Access::NO_ACCESS
end
it 'returns discussion json' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes individual_note])
end
context 'with cross-reference system note', :request_store do
let(:new_issue) { create(:issue) }
let(:cross_reference) { "mentioned in #{new_issue.to_reference(issue.project)}" }
......@@ -967,12 +935,6 @@ describe Projects::IssuesController do
create(:discussion_note_on_issue, :system, noteable: issue, project: issue.project, note: cross_reference)
end
it 'filters notes that the user should not see' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
expect(JSON.parse(response.body).count).to eq(1)
end
it 'does not result in N+1 queries' do
# Instantiate the controller variables to ensure QueryRecorder has an accurate base count
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
......
......@@ -320,12 +320,6 @@ describe API::Jobs do
it 'does not return job artifacts if not uploaded' do
expect(response).to have_gitlab_http_status(404)
end
it 'returns specific job artifacts' do
expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include(download_headers)
expect(response.body).to match_file(job.artifacts_file.file.file)
end
end
end
......@@ -360,10 +354,6 @@ describe API::Jobs do
end
end
end
it 'does not return job artifacts if not uploaded' do
expect(response).to have_gitlab_http_status(404)
end
end
describe 'GET /projects/:id/artifacts/:ref_name/download?job=name' do
......@@ -446,9 +436,6 @@ describe API::Jobs do
expect(response).to have_gitlab_http_status(302)
end
end
it { expect(response).to have_gitlab_http_status(200) }
it { expect(response.headers).to include(download_headers) }
end
context 'with regular branch' do
......
......@@ -1188,11 +1188,6 @@ describe API::Runner do
expect(response).to have_gitlab_http_status(302)
end
end
it 'download artifacts' do
expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include download_headers
end
end
context 'when using runnners token' do
......
......@@ -220,12 +220,6 @@ describe API::V3::Builds do
it 'returns location redirect' do
expect(response).to have_gitlab_http_status(302)
end
it 'returns specific job artifacts' do
expect(response).to have_gitlab_http_status(200)
expect(response.headers).to include(download_headers)
expect(response.body).to match_file(build.artifacts_file.file.file)
end
end
context 'unauthorized user' do
......@@ -321,9 +315,6 @@ describe API::V3::Builds do
expect(response).to have_gitlab_http_status(302)
end
end
it { expect(response).to have_gitlab_http_status(200) }
it { expect(response.headers).to include(download_headers) }
end
context 'with regular branch' do
......
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