diff options
author | ubudzisz <ubudzisz@gmail.com> | 2016-07-14 15:51:10 +0300 |
---|---|---|
committer | ubudzisz <ubudzisz@gmail.com> | 2016-07-18 13:39:24 +0300 |
commit | 85fc83c5888411bcc1ee7ec7dc75a7d902f821cb (patch) | |
tree | f5c7412737945b7bf45bf67b2efbc4c0fe645588 /spec/views | |
parent | 86df8bc3530121440c3d4e3a56758206eaf73710 (diff) |
add test to view
repair rubocop test and update CHANGELOG
repair rubocop test
repair rubocop
repair rubocop
repair rubocop
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/builds/show.html.haml_spec.rb | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/spec/views/projects/builds/show.html.haml_spec.rb b/spec/views/projects/builds/show.html.haml_spec.rb index c66f15e3c0b..c71705fe8e5 100644 --- a/spec/views/projects/builds/show.html.haml_spec.rb +++ b/spec/views/projects/builds/show.html.haml_spec.rb @@ -3,12 +3,15 @@ require 'spec_helper' describe 'projects/builds/show' do include Devise::TestHelpers - let(:build) { create(:ci_build) } - let(:project) { build.project } + let(:project) { create(:project) } + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + let(:commit) { project.commit } before do assign(:build, build) assign(:project, project) + assign(:commit_title, build.project.commit.title) allow(view).to receive(:can?).and_return(true) end @@ -22,10 +25,6 @@ describe 'projects/builds/show' do it 'does not show retry button' do expect(rendered).not_to have_link('Retry') end - - it 'shows commit title' do - expect(rendered).to have_text(@git_commit_title) - end end context 'when build is not running' do @@ -37,10 +36,18 @@ describe 'projects/builds/show' do it 'shows retry button' do expect(rendered).to have_link('Retry') end + end - it 'shows commit title' do - expect(rendered).to have_text(@git_commit_title) + context 'show commit title' do + before do + build.run! + render end - end + it 'show commit title' do + within('p.build-light-text.append-bottom-0') do + assert page.has_content?(commit.title) + end + end + end end |