Merge branch 'b-rails5-fix-spec-controllers-projects-jobs_controller_spec-rb' into 'master'
Resolve "[Rails5] Fix spec/controllers/projects/jobs_controller_spec.rb" Closes #46227 See merge request gitlab-org/gitlab-ce!18891
This commit is contained in:
commit
da49a357da
1 changed files with 12 additions and 12 deletions
|
@ -490,43 +490,43 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
|
|||
id: job.id
|
||||
end
|
||||
|
||||
context 'when job has a trace artifact' do
|
||||
context "when job has a trace artifact" do
|
||||
let(:job) { create(:ci_build, :trace_artifact, pipeline: pipeline) }
|
||||
|
||||
it 'returns a trace' do
|
||||
response = subject
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
expect(response.content_type).to eq 'text/plain; charset=utf-8'
|
||||
expect(response.body).to eq job.job_artifacts_trace.open.read
|
||||
expect(response.headers["Content-Type"]).to eq("text/plain; charset=utf-8")
|
||||
expect(response.body).to eq(job.job_artifacts_trace.open.read)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when job has a trace file' do
|
||||
context "when job has a trace file" do
|
||||
let(:job) { create(:ci_build, :trace_live, pipeline: pipeline) }
|
||||
|
||||
it 'send a trace file' do
|
||||
it "send a trace file" do
|
||||
response = subject
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
expect(response.content_type).to eq 'text/plain; charset=utf-8'
|
||||
expect(response.body).to eq 'BUILD TRACE'
|
||||
expect(response.headers["Content-Type"]).to eq("text/plain; charset=utf-8")
|
||||
expect(response.body).to eq("BUILD TRACE")
|
||||
end
|
||||
end
|
||||
|
||||
context 'when job has a trace in database' do
|
||||
context "when job has a trace in database" do
|
||||
let(:job) { create(:ci_build, pipeline: pipeline) }
|
||||
|
||||
before do
|
||||
job.update_column(:trace, 'Sample trace')
|
||||
job.update_column(:trace, "Sample trace")
|
||||
end
|
||||
|
||||
it 'send a trace file' do
|
||||
it "send a trace file" do
|
||||
response = subject
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
expect(response.content_type).to eq 'text/plain; charset=utf-8'
|
||||
expect(response.body).to eq 'Sample trace'
|
||||
expect(response.headers["Content-Type"]).to eq("text/plain; charset=utf-8")
|
||||
expect(response.body).to eq("Sample trace")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue