diff options
Diffstat (limited to 'spec/views/projects/_last_commit.html.haml_spec.rb')
-rw-r--r-- | spec/views/projects/_last_commit.html.haml_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/views/projects/_last_commit.html.haml_spec.rb b/spec/views/projects/_last_commit.html.haml_spec.rb new file mode 100644 index 00000000000..eea1695b171 --- /dev/null +++ b/spec/views/projects/_last_commit.html.haml_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe 'projects/_last_commit', :view do + let(:project) { create(:project, :repository) } + + context 'when there is a pipeline present for the commit' do + context 'when pipeline is blocked' do + let!(:pipeline) do + create(:ci_pipeline, :blocked, project: project, + sha: project.commit.id) + end + + it 'shows correct pipeline badge' do + render 'projects/last_commit', commit: project.commit, + project: project, + ref: :master + + expect(rendered).to have_text "blocked #{project.commit.short_id}" + end + end + end +end |