2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
RSpec.describe 'Resolvers::ProjectPackagesResolver' do
|
2020-07-28 23:09:34 +05:30
|
|
|
include GraphqlHelpers
|
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
let_it_be(:described_class) { Resolvers::ProjectPackagesResolver }
|
2020-07-28 23:09:34 +05:30
|
|
|
let_it_be(:user) { create(:user) }
|
2021-06-08 01:23:25 +05:30
|
|
|
let_it_be_with_reload(:project) { create(:project, :public) }
|
|
|
|
|
|
|
|
let(:args) do
|
2022-07-23 23:45:48 +05:30
|
|
|
{ sort: 'CREATED_DESC' }
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
describe '#resolve' do
|
2022-07-23 23:45:48 +05:30
|
|
|
subject do
|
|
|
|
resolve(described_class, ctx: { current_user: user }, obj: project, args: args)
|
|
|
|
.to_a
|
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
it_behaves_like 'group and projects packages resolver'
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
end
|