Commit 81510b46 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add feature specs for raw trace

parent bf4371d6
...@@ -63,7 +63,7 @@ class Projects::BuildsController < Projects::ApplicationController ...@@ -63,7 +63,7 @@ class Projects::BuildsController < Projects::ApplicationController
end end
def raw def raw
response.headers['Content-Typei'] = 'text/plain' response.headers['Content-Type'] = 'text/plain; charset=utf-8'
if @build.has_trace? if @build.has_trace?
response.headers['X-Sendfile'] = @build.path_to_trace response.headers['X-Sendfile'] = @build.path_to_trace
else else
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
= icon('folder-open') = icon('folder-open')
Browse Browse
.build-widget .build-widget.build-controls
%h4.title %h4.title
Build ##{@build.id} Build ##{@build.id}
- if can?(current_user, :update_build, @project) - if can?(current_user, :update_build, @project)
......
...@@ -86,6 +86,20 @@ describe "Builds" do ...@@ -86,6 +86,20 @@ describe "Builds" do
end end
end end
end end
context 'Build raw trace' do
before do
@build.run!
@build.trace = 'BUILD TRACE'
visit namespace_project_build_path(@project.namespace, @project, @build)
end
it do
page.within('.build-controls') do
expect(page).to have_content 'Raw'
end
end
end
end end
describe "POST /:project/builds/:id/cancel" do describe "POST /:project/builds/:id/cancel" do
...@@ -120,4 +134,16 @@ describe "Builds" do ...@@ -120,4 +134,16 @@ describe "Builds" do
it { expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type) } it { expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type) }
end end
describe "GET /:project/builds/:id/raw" do
before do
@build.run!
@build.trace = 'BUILD TRACE'
visit namespace_project_build_path(@project.namespace, @project, @build)
page.within('.build-controls') { click_link 'Raw' }
end
it { expect(page.response_headers['Content-Type']).to eq('text/plain; charset=utf-8') }
it { expect(page.response_headers['X-Sendfile']).to eq(@build.path_to_trace) }
end
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