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/serializers/diff_file_entity_spec.rb')
-rw-r--r--spec/serializers/diff_file_entity_spec.rb44
1 files changed, 5 insertions, 39 deletions
diff --git a/spec/serializers/diff_file_entity_spec.rb b/spec/serializers/diff_file_entity_spec.rb
index 48099cb1fdf..fbb45162136 100644
--- a/spec/serializers/diff_file_entity_spec.rb
+++ b/spec/serializers/diff_file_entity_spec.rb
@@ -80,47 +80,13 @@ RSpec.describe DiffFileEntity do
end
end
- describe '#is_fully_expanded' do
- context 'file with a conflict' do
- let(:options) { { conflicts: { diff_file.new_path => double(diff_lines_for_serializer: [], conflict_type: :both_modified) } } }
-
- it 'returns false' do
- expect(diff_file).not_to receive(:fully_expanded?)
- expect(subject[:is_fully_expanded]).to eq(false)
- end
- end
- end
-
describe '#highlighted_diff_lines' do
- context 'file without a conflict' do
- let(:options) { { conflicts: {} } }
+ let(:options) { { conflicts: {} } }
- it 'calls diff_lines_for_serializer on diff_file' do
- # #diff_lines_for_serializer gets called in #fully_expanded? as well so we expect twice
- expect(diff_file).to receive(:diff_lines_for_serializer).twice.and_return([])
- expect(subject[:highlighted_diff_lines]).to eq([])
- end
- end
-
- context 'file with a conflict' do
- let(:conflict_file) { instance_double(Gitlab::Conflict::File, conflict_type: :both_modified) }
- let(:options) { { conflicts: { diff_file.new_path => conflict_file } } }
-
- it 'calls diff_lines_for_serializer on matching conflict file' do
- expect(conflict_file).to receive(:diff_lines_for_serializer).and_return([])
- expect(subject[:highlighted_diff_lines]).to eq([])
- end
-
- context 'when Gitlab::Git::Conflict::Parser::UnmergeableFile gets raised' do
- before do
- allow(conflict_file).to receive(:diff_lines_for_serializer).and_raise(Gitlab::Git::Conflict::Parser::UnmergeableFile)
- end
-
- it 'falls back to diff_file diff_lines_for_serializer' do
- expect(diff_file).to receive(:diff_lines_for_serializer).and_return([])
- expect(subject[:highlighted_diff_lines]).to eq([])
- end
- end
+ it 'calls diff_lines_for_serializer on diff_file' do
+ # #diff_lines_for_serializer gets called in #fully_expanded? as well so we expect twice
+ expect(diff_file).to receive(:diff_lines_for_serializer).twice.and_return([])
+ expect(subject[:highlighted_diff_lines]).to eq([])
end
end