summaryrefslogtreecommitdiff
path: root/spec/helpers/commits_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/commits_helper_spec.rb')
-rw-r--r--spec/helpers/commits_helper_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/helpers/commits_helper_spec.rb b/spec/helpers/commits_helper_spec.rb
index e036e97f745..cc318a21fc9 100644
--- a/spec/helpers/commits_helper_spec.rb
+++ b/spec/helpers/commits_helper_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe CommitsHelper do
+RSpec.describe CommitsHelper do
describe 'commit_author_link' do
it 'escapes the author email' do
commit = double(
@@ -51,6 +51,20 @@ describe CommitsHelper do
end
end
+ describe '#view_file_button' do
+ let(:project) { build(:project) }
+ let(:path) { 'path/to/file' }
+ let(:sha) { '1234567890' }
+
+ subject do
+ helper.view_file_button(sha, path, project)
+ end
+
+ it 'links to project files' do
+ expect(subject).to have_link('1234567', href: helper.project_blob_path(project, "#{sha}/#{path}"))
+ end
+ end
+
describe '#view_on_environment_button' do
let(:project) { create(:project) }
let(:environment) { create(:environment, external_url: 'http://example.com') }