From 81510b46d5f2f8ee23cd8c5ba5feacee233ef681 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Sun, 17 Apr 2016 18:19:23 +0200 Subject: Add feature specs for raw trace --- spec/features/builds_spec.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'spec/features') diff --git a/spec/features/builds_spec.rb b/spec/features/builds_spec.rb index 6da3a857b3f..8c99dd57a1a 100644 --- a/spec/features/builds_spec.rb +++ b/spec/features/builds_spec.rb @@ -86,6 +86,20 @@ describe "Builds" do 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 describe "POST /:project/builds/:id/cancel" do @@ -120,4 +134,16 @@ describe "Builds" do it { expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type) } 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 -- cgit v1.2.1