Commit bd7c52c7 authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Grzegorz Bizon

Add feature specs for build erase button

parent f3e92fb4
...@@ -13,3 +13,10 @@ Feature: Project Builds Summary ...@@ -13,3 +13,10 @@ Feature: Project Builds Summary
Scenario: I browse project builds page Scenario: I browse project builds page
When I visit project builds page When I visit project builds page
Then I see button to CI Lint Then I see button to CI Lint
Scenario: I erase a build
Given recent build has a build trace
When I visit recent build details page
And I click erase build button
Then recent build has been erased
And recent build summary does not have artifacts widget
...@@ -10,4 +10,18 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps ...@@ -10,4 +10,18 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
expect(ci_lint_tool_link[:href]).to eq ci_lint_path expect(ci_lint_tool_link[:href]).to eq ci_lint_path
end end
end end
step 'I click erase build button' do
click_link 'Erase'
end
step 'recent build has been erased' do
expect(@build.artifacts_file.exists?).to be_falsy
expect(@build.artifacts_metadata.exists?).to be_falsy
expect(File.zero?(@build.path_to_trace)).to be true
end
step 'recent build summary does not have artifacts widget' do
expect(page).to have_no_css('.artifacts')
end
end end
...@@ -42,6 +42,10 @@ module SharedBuilds ...@@ -42,6 +42,10 @@ module SharedBuilds
@build.update_attributes(artifacts_metadata: gzip) @build.update_attributes(artifacts_metadata: gzip)
end end
step 'recent build has a build trace' do
@build.trace = 'build trace'
end
step 'download of build artifacts archive starts' do step 'download of build artifacts archive starts' do
expect(page.response_headers['Content-Type']).to eq 'application/zip' expect(page.response_headers['Content-Type']).to eq 'application/zip'
expect(page.response_headers['Content-Transfer-Encoding']).to eq 'binary' expect(page.response_headers['Content-Transfer-Encoding']).to eq 'binary'
......
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