diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-28 15:05:32 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-30 12:06:19 +0300 |
commit | 94cec500c534ac8b35d7d7d9c807646faa800fec (patch) | |
tree | aef7be6221e64dd8d134dce495f6dae7c72e58a0 /spec/views | |
parent | 2efee5f6410f4e8e40e9b0339393de80f4affdde (diff) |
Do not show build retry link when build is active
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/builds/show.html.haml_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/views/projects/builds/show.html.haml_spec.rb b/spec/views/projects/builds/show.html.haml_spec.rb new file mode 100644 index 00000000000..cd18d19ef5e --- /dev/null +++ b/spec/views/projects/builds/show.html.haml_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe 'projects/builds/show' do + include Devise::TestHelpers + + let(:build) { create(:ci_build) } + let(:project) { build.project } + + before do + assign(:build, build) + assign(:project, project) + + allow(view).to receive(:can?).and_return(true) + end + + context 'when build is running' do + before do + build.run! + render + end + + it 'does not show retry button' do + expect(rendered).not_to have_link('Retry') + end + end + + context 'when build is not running' do + before do + build.success! + render + end + + it 'shows retry button' do + expect(rendered).to have_link('Retry') + end + end +end |