diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/support/shared_examples/lib/gitlab | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/support/shared_examples/lib/gitlab')
-rw-r--r-- | spec/support/shared_examples/lib/gitlab/search_results_sorted_shared_examples.rb | 24 | ||||
-rw-r--r-- | spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb | 8 |
2 files changed, 20 insertions, 12 deletions
diff --git a/spec/support/shared_examples/lib/gitlab/search_results_sorted_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/search_results_sorted_shared_examples.rb index 07d01d5c50e..eafb49cef71 100644 --- a/spec/support/shared_examples/lib/gitlab/search_results_sorted_shared_examples.rb +++ b/spec/support/shared_examples/lib/gitlab/search_results_sorted_shared_examples.rb @@ -1,19 +1,35 @@ # frozen_string_literal: true RSpec.shared_examples 'search results sorted' do - context 'sort: newest' do + context 'sort: created_desc' do let(:sort) { 'created_desc' } it 'sorts results by created_at' do - expect(results.objects(scope).map(&:id)).to eq([new_result.id, old_result.id, very_old_result.id]) + expect(results_created.objects(scope).map(&:id)).to eq([new_result.id, old_result.id, very_old_result.id]) end end - context 'sort: oldest' do + context 'sort: created_asc' do let(:sort) { 'created_asc' } it 'sorts results by created_at' do - expect(results.objects(scope).map(&:id)).to eq([very_old_result.id, old_result.id, new_result.id]) + expect(results_created.objects(scope).map(&:id)).to eq([very_old_result.id, old_result.id, new_result.id]) + end + end + + context 'sort: updated_desc' do + let(:sort) { 'updated_desc' } + + it 'sorts results by updated_desc' do + expect(results_updated.objects(scope).map(&:id)).to eq([new_updated.id, old_updated.id, very_old_updated.id]) + end + end + + context 'sort: updated_asc' do + let(:sort) { 'updated_asc' } + + it 'sorts results by updated_asc' do + expect(results_updated.objects(scope).map(&:id)).to eq([very_old_updated.id, old_updated.id, new_updated.id]) end end end diff --git a/spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb b/spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb index 286305f2506..edd9b6cdf37 100644 --- a/spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb +++ b/spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb @@ -24,12 +24,4 @@ RSpec.shared_examples 'a tracked issue edit event' do |event| it 'does not track edit actions if author is not present' do expect(track_action(author: nil)).to be_nil end - - context 'when feature flag track_issue_activity_actions is disabled' do - it 'does not track edit actions' do - stub_feature_flags(track_issue_activity_actions: false) - - expect(track_action(author: user1)).to be_nil - end - end end |