debian-mirror-gitlab/spec/finders/achievements/achievements_finder_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
726 B
Ruby
Raw Permalink Normal View History

2023-06-20 00:43:36 +05:30
# 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