diff options
Diffstat (limited to 'spec/views/projects/commit')
-rw-r--r-- | spec/views/projects/commit/_commit_box.html.haml_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/projects/commit/show.html.haml_spec.rb | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb index c503e085d02..4335a0901ae 100644 --- a/spec/views/projects/commit/_commit_box.html.haml_spec.rb +++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'projects/commit/_commit_box.html.haml' do it 'shows the commit SHA' do render - expect(rendered).to have_text("#{Commit.truncate_sha(project.commit.sha)}") + expect(rendered).to have_text(Commit.truncate_sha(project.commit.sha).to_s) end context 'when there is a pipeline present' do diff --git a/spec/views/projects/commit/show.html.haml_spec.rb b/spec/views/projects/commit/show.html.haml_spec.rb index 59182f6e757..4d5c987ce37 100644 --- a/spec/views/projects/commit/show.html.haml_spec.rb +++ b/spec/views/projects/commit/show.html.haml_spec.rb @@ -67,5 +67,13 @@ RSpec.describe 'projects/commit/show.html.haml' do expect(rendered).to have_content("This commit is part of merge request") expect(rendered).to have_link(merge_request.to_reference, href: merge_request_url) end + + context 'when merge request is nil' do + let(:merge_request) { nil } + + it 'renders the page' do + expect { rendered }.not_to raise_error + end + end end end |