Commit 258cdd14 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Update jobs_spec for changes from builds_spec

parent 6c72d8a2
This diff is collapsed.
...@@ -219,7 +219,7 @@ feature 'Jobs', :feature do ...@@ -219,7 +219,7 @@ feature 'Jobs', :feature do
end end
it do it do
expect(page).to have_link 'Raw' expect(page).to have_css('.js-raw-link')
end end
end end
...@@ -282,7 +282,7 @@ feature 'Jobs', :feature do ...@@ -282,7 +282,7 @@ feature 'Jobs', :feature do
end end
end end
context 'job is complete and not successfull' do context 'job is complete and not successful' do
let(:build) { create(:ci_build, :failed, environment: environment.name, pipeline: pipeline) } let(:build) { create(:ci_build, :failed, environment: environment.name, pipeline: pipeline) }
it 'shows a link for the job' do it 'shows a link for the job' do
...@@ -305,7 +305,7 @@ feature 'Jobs', :feature do ...@@ -305,7 +305,7 @@ feature 'Jobs', :feature do
end end
end end
describe "POST /:project/builds/:id/cancel" do describe "POST /:project/jobs/:id/cancel" do
context "Job from project" do context "Job from project" do
before do before do
build.run! build.run!
...@@ -331,7 +331,7 @@ feature 'Jobs', :feature do ...@@ -331,7 +331,7 @@ feature 'Jobs', :feature do
end end
end end
describe "POST /:project/builds/:id/retry" do describe "POST /:project/jobs/:id/retry" do
context "Job from project" do context "Job from project" do
before do before do
build.run! build.run!
...@@ -381,7 +381,7 @@ feature 'Jobs', :feature do ...@@ -381,7 +381,7 @@ feature 'Jobs', :feature do
end end
end end
describe "GET /:project/builds/:id/download" do describe "GET /:project/jobs/:id/download" do
before do before do
build.update_attributes(artifacts_file: artifacts_file) build.update_attributes(artifacts_file: artifacts_file)
visit namespace_project_job_path(project.namespace, project, build) visit namespace_project_job_path(project.namespace, project, build)
...@@ -398,14 +398,14 @@ feature 'Jobs', :feature do ...@@ -398,14 +398,14 @@ feature 'Jobs', :feature do
end end
end end
describe 'GET /:project/builds/:id/raw' do describe 'GET /:project/jobs/:id/raw', :js do
context 'access source' do context 'access source' do
context 'build from project' do context 'build from project' do
before do before do
Capybara.current_session.driver.header('X-Sendfile-Type', 'X-Sendfile') Capybara.current_session.driver.headers = { 'X-Sendfile-Type' => 'X-Sendfile' }
build.run! build.run!
visit namespace_project_job_path(project.namespace, project, build) visit namespace_project_job_path(project.namespace, project, build)
page.within('.js-build-sidebar') { click_link 'Raw' } find('.js-raw-link-controller').click()
end end
it 'sends the right headers' do it 'sends the right headers' do
...@@ -415,9 +415,9 @@ feature 'Jobs', :feature do ...@@ -415,9 +415,9 @@ feature 'Jobs', :feature do
end end
end end
context 'build from other project' do context 'job from other project' do
before do before do
Capybara.current_session.driver.header('X-Sendfile-Type', 'X-Sendfile') Capybara.current_session.driver.headers = { 'X-Sendfile-Type' => 'X-Sendfile' }
build2.run! build2.run!
visit raw_namespace_project_job_path(project.namespace, project, build2) visit raw_namespace_project_job_path(project.namespace, project, build2)
end end
...@@ -432,7 +432,7 @@ feature 'Jobs', :feature do ...@@ -432,7 +432,7 @@ feature 'Jobs', :feature do
let(:existing_file) { Tempfile.new('existing-trace-file').path } let(:existing_file) { Tempfile.new('existing-trace-file').path }
before do before do
Capybara.current_session.driver.header('X-Sendfile-Type', 'X-Sendfile') Capybara.current_session.driver.headers = { 'X-Sendfile-Type' => 'X-Sendfile' }
build.run! build.run!
...@@ -442,13 +442,13 @@ feature 'Jobs', :feature do ...@@ -442,13 +442,13 @@ feature 'Jobs', :feature do
visit namespace_project_job_path(project.namespace, project, build) visit namespace_project_job_path(project.namespace, project, build)
end end
context 'when build has trace in file' do context 'when build has trace in file', :js do
let(:paths) do let(:paths) do
[existing_file] [existing_file]
end end
before do before do
page.within('.js-build-sidebar') { click_link 'Raw' } find('.js-raw-link-controller').click()
end end
it 'sends the right headers' do it 'sends the right headers' do
...@@ -462,7 +462,7 @@ feature 'Jobs', :feature do ...@@ -462,7 +462,7 @@ feature 'Jobs', :feature do
let(:paths) { [] } let(:paths) { [] }
it 'sends the right headers' do it 'sends the right headers' do
expect(page.status_code).not_to have_link('Raw') expect(page.status_code).not_to have_selector('.js-raw-link-controller')
end end
end end
end end
...@@ -483,7 +483,7 @@ feature 'Jobs', :feature do ...@@ -483,7 +483,7 @@ feature 'Jobs', :feature do
end end
describe "GET /:project/jobs/:id/trace.json" do describe "GET /:project/jobs/:id/trace.json" do
context "Job from project" do context "Build from project" do
before do before do
visit trace_namespace_project_job_path(project.namespace, project, build, format: :json) visit trace_namespace_project_job_path(project.namespace, project, build, format: :json)
end end
...@@ -491,7 +491,7 @@ feature 'Jobs', :feature do ...@@ -491,7 +491,7 @@ feature 'Jobs', :feature do
it { expect(page.status_code).to eq(200) } it { expect(page.status_code).to eq(200) }
end end
context "Job from other project" do context "Build from other project" do
before do before do
visit trace_namespace_project_job_path(project.namespace, project, build2, format: :json) visit trace_namespace_project_job_path(project.namespace, project, build2, format: :json)
end end
...@@ -501,7 +501,7 @@ feature 'Jobs', :feature do ...@@ -501,7 +501,7 @@ feature 'Jobs', :feature do
end end
describe "GET /:project/jobs/:id/status" do describe "GET /:project/jobs/:id/status" do
context "Job from project" do context "Build from project" do
before do before do
visit status_namespace_project_job_path(project.namespace, project, build) visit status_namespace_project_job_path(project.namespace, project, build)
end end
...@@ -509,7 +509,7 @@ feature 'Jobs', :feature do ...@@ -509,7 +509,7 @@ feature 'Jobs', :feature do
it { expect(page.status_code).to eq(200) } it { expect(page.status_code).to eq(200) }
end end
context "Job from other project" do context "Build from other project" do
before do before do
visit status_namespace_project_job_path(project.namespace, project, build2) visit status_namespace_project_job_path(project.namespace, project, build2)
end end
......
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