2021-01-14 07:10:54 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe Resolvers::PackageDetailsResolver do
|
|
|
|
include GraphqlHelpers
|
|
|
|
|
|
|
|
let_it_be_with_reload(:project) { create(:project) }
|
2022-01-20 04:11:11 -05:00
|
|
|
let_it_be(:user) { project.first_owner }
|
2021-01-14 07:10:54 -05:00
|
|
|
let_it_be(:package) { create(:composer_package, project: project) }
|
|
|
|
|
|
|
|
describe '#resolve' do
|
|
|
|
let(:args) do
|
2021-02-01 10:08:56 -05:00
|
|
|
{ id: global_id_of(package) }
|
2021-01-14 07:10:54 -05:00
|
|
|
end
|
|
|
|
|
2021-02-01 10:08:56 -05:00
|
|
|
subject { force(resolve(described_class, ctx: { current_user: user }, args: args)) }
|
2021-01-14 07:10:54 -05:00
|
|
|
|
|
|
|
it { is_expected.to eq(package) }
|
|
|
|
end
|
|
|
|
end
|