Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/github_import/representation')
-rw-r--r--spec/lib/gitlab/github_import/representation/diff_note_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb
index 3e76b4ae698..be202733a89 100644
--- a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb
+++ b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb
@@ -104,7 +104,8 @@ RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_red
old_line: nil,
old_path: 'README.md',
position_type: 'text',
- start_sha: 'start'
+ start_sha: 'start',
+ ignore_whitespace_change: false
)
end
end
@@ -122,7 +123,8 @@ RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_red
new_line: nil,
old_path: 'README.md',
position_type: 'text',
- start_sha: 'start'
+ start_sha: 'start',
+ ignore_whitespace_change: false
)
end
end
@@ -144,6 +146,14 @@ RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_red
expect(note.line_code).to eq('8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d_2_2')
end
+
+ context 'when comment on file' do
+ it 'generates line code for first line' do
+ note = described_class.new(diff_hunk: '', file_path: 'README.md', subject_type: 'file')
+
+ expect(note.line_code).to eq('8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d_1_1')
+ end
+ end
end
describe '#note and #contains_suggestion?' do