diff options
Diffstat (limited to 'spec/helpers/diff_helper_spec.rb')
-rw-r--r-- | spec/helpers/diff_helper_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb index 63aa41bbad5..ef1f0940074 100644 --- a/spec/helpers/diff_helper_spec.rb +++ b/spec/helpers/diff_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffHelper do +RSpec.describe DiffHelper do include RepoHelpers let(:project) { create(:project, :repository) } @@ -303,6 +303,20 @@ describe DiffHelper do end end + describe '#diff_file_html_data' do + let(:project) { build(:project) } + let(:path) { 'path/to/file' } + let(:sha) { '1234567890' } + + subject do + helper.diff_file_html_data(project, path, sha) + end + + it 'returns data for project files' do + expect(subject).to include(blob_diff_path: helper.project_blob_diff_path(project, "#{sha}/#{path}")) + end + end + describe '#diff_file_path_text' do it 'returns full path by default' do expect(diff_file_path_text(diff_file)).to eq(diff_file.new_path) |