diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index d58f634425b9f4cc39b011307178c9d7b4331b2d..ace8bae03acbeb6b1842a021a4b25d7a97efb8be 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -18,7 +18,7 @@ def commit_committer_link(commit, options = {}) end def commit_to_html(commit, ref, project) - render 'projects/commits/commit', + render 'projects/commits/commit.html', commit: commit, ref: ref, project: project diff --git a/spec/helpers/commits_helper_spec.rb b/spec/helpers/commits_helper_spec.rb index cbc5566979b4e6d1ef48b97d78e7eaafc5fff403..dd268c2411f3e9fbe858ed387441f7fbe9837a7c 100644 --- a/spec/helpers/commits_helper_spec.rb +++ b/spec/helpers/commits_helper_spec.rb @@ -69,4 +69,17 @@ expect(node[:href]).to eq('http://example.com/file.html') end end + + describe '#commit_to_html' do + let(:project) { create(:project, :repository) } + let(:ref) { 'master' } + let(:commit) { project.commit(ref) } + + it 'renders HTML representation of a commit' do + assign(:project, project) + allow(helper).to receive(:current_user).and_return(project.owner) + + expect(helper.commit_to_html(commit, ref, project)).to include('<div class="commit-content') + end + end end