diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 06:17:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-20 06:17:54 +0300 |
commit | e3523242123f949261d968ec942c6dc10ad6c772 (patch) | |
tree | 7a26983ed5e8866051ee3cd3e9085ad074164ff8 /spec/finders | |
parent | 8277a5b4ba05fe11174397c689c66cef5c06fc38 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/achievements/achievements_finder_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/finders/achievements/achievements_finder_spec.rb b/spec/finders/achievements/achievements_finder_spec.rb new file mode 100644 index 00000000000..3ac18c27494 --- /dev/null +++ b/spec/finders/achievements/achievements_finder_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Achievements::AchievementsFinder, feature_category: :user_profile do + let_it_be(:group) { create(:group) } + let_it_be(:achievements) { create_list(:achievement, 3, namespace: group) } + + let(:params) { {} } + + describe '#execute' do + subject { described_class.new(group, params).execute } + + it 'returns all achievements' do + expect(subject).to match_array(achievements) + end + + context 'when ids param provided' do + let(:params) { { ids: [achievements[0].id, achievements[1].id] } } + + it 'returns specified achievements' do + expect(subject).to contain_exactly(achievements[0], achievements[1]) + end + end + end +end |