提交 bd7c52c7 编写于 作者: G Grzegorz Bizon 提交者: Grzegorz Bizon

Add feature specs for build erase button

上级 f3e92fb4
......@@ -13,3 +13,10 @@ Feature: Project Builds Summary
Scenario: I browse project builds page
When I visit project builds page
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
expect(ci_lint_tool_link[:href]).to eq ci_lint_path
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
......@@ -42,6 +42,10 @@ module SharedBuilds
@build.update_attributes(artifacts_metadata: gzip)
end
step 'recent build has a build trace' do
@build.trace = 'build trace'
end
step 'download of build artifacts archive starts' do
expect(page.response_headers['Content-Type']).to eq 'application/zip'
expect(page.response_headers['Content-Transfer-Encoding']).to eq 'binary'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册