diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-21 15:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-21 15:09:17 +0300 |
commit | 0c4570435d417b69efd433057f95f01810618837 (patch) | |
tree | 4e402832206b83da2d73671977c1e5f7cae9074a /spec/serializers | |
parent | 49abdb108a4d3c3f2ef9b27c7c4dcde43da1016a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/diff_viewer_entity_spec.rb | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/spec/serializers/diff_viewer_entity_spec.rb b/spec/serializers/diff_viewer_entity_spec.rb index 84d2bdceb78..7ee2f8ec12f 100644 --- a/spec/serializers/diff_viewer_entity_spec.rb +++ b/spec/serializers/diff_viewer_entity_spec.rb @@ -16,47 +16,27 @@ RSpec.describe DiffViewerEntity do subject { described_class.new(viewer).as_json(options) } - context 'when add_ignore_all_white_spaces is enabled' do - before do - stub_feature_flags(add_ignore_all_white_spaces: true) - end - - it 'serializes diff file viewer' do - expect(subject.with_indifferent_access).to match_schema('entities/diff_viewer') - end - - it 'contains whitespace_only attribute' do - expect(subject.with_indifferent_access).to include(:whitespace_only) - end - - context 'when whitespace_only option is true' do - let(:options) { { whitespace_only: true } } + it 'serializes diff file viewer' do + expect(subject.with_indifferent_access).to match_schema('entities/diff_viewer') + end - it 'returns the whitespace_only attribute true' do - expect(subject.with_indifferent_access[:whitespace_only]).to eq true - end - end + it 'contains whitespace_only attribute' do + expect(subject.with_indifferent_access).to include(:whitespace_only) + end - context 'when whitespace_only option is false' do - let(:options) { { whitespace_only: false } } + context 'when whitespace_only option is true' do + let(:options) { { whitespace_only: true } } - it 'returns the whitespace_only attribute false' do - expect(subject.with_indifferent_access[:whitespace_only]).to eq false - end + it 'returns the whitespace_only attribute true' do + expect(subject.with_indifferent_access[:whitespace_only]).to eq true end end - context 'when add_ignore_all_white_spaces is disabled ' do - before do - stub_feature_flags(add_ignore_all_white_spaces: false) - end - - it 'serializes diff file viewer' do - expect(subject.with_indifferent_access).to match_schema('entities/diff_viewer') - end + context 'when whitespace_only option is false' do + let(:options) { { whitespace_only: false } } - it 'does not contain whitespace_only attribute' do - expect(subject.with_indifferent_access).not_to include(:whitespace_only) + it 'returns the whitespace_only attribute false' do + expect(subject.with_indifferent_access[:whitespace_only]).to eq false end end end |