Improve and fix specs for raw trace

This commit is contained in:
Tomasz Maczukin 2016-04-19 13:02:41 +02:00
parent 0a13f5f864
commit fa337ca046
No known key found for this signature in database
GPG key ID: 7E9EB2E4B0F625CD

View file

@ -96,7 +96,7 @@ describe "Builds" do
it do it do
page.within('.build-controls') do page.within('.build-controls') do
expect(page).to have_content 'Raw' expect(page).to have_link 'Raw'
end end
end end
end end
@ -137,13 +137,17 @@ describe "Builds" do
describe "GET /:project/builds/:id/raw" do describe "GET /:project/builds/:id/raw" do
before do before do
Capybara.current_session.driver.header('X-Sendfile-Type', 'X-Sendfile')
@build.run! @build.run!
@build.trace = 'BUILD TRACE' @build.trace = 'BUILD TRACE'
visit namespace_project_build_path(@project.namespace, @project, @build) visit namespace_project_build_path(@project.namespace, @project, @build)
page.within('.build-controls') { click_link 'Raw' }
end end
it { expect(page.response_headers['Content-Type']).to eq('text/plain; charset=utf-8') } it 'sends the right headers' do
it { expect(page.response_headers['X-Sendfile']).to eq(@build.path_to_trace) } page.within('.build-controls') { click_link 'Raw' }
expect(page.response_headers['Content-Type']).to eq('text/plain; charset=utf-8')
expect(page.response_headers['X-Sendfile']).to eq(@build.path_to_trace)
end
end end
end end