2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe Resolvers::Ci::RunnerSetupResolver, feature_category: :runner_fleet do
|
2021-01-29 00:20:46 +05:30
|
|
|
include GraphqlHelpers
|
|
|
|
|
|
|
|
describe '#resolve' do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
subject(:resolve_subject) { resolve(described_class, ctx: { current_user: user }, args: { platform: platform, architecture: 'amd64' }) }
|
2021-01-29 00:20:46 +05:30
|
|
|
|
|
|
|
context 'with container platforms' do
|
|
|
|
let(:platform) { 'docker' }
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
|
|
|
it 'returns install instructions' do
|
|
|
|
expect(resolve_subject[:install_instructions]).not_to eq(nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not return register instructions' do
|
|
|
|
expect(resolve_subject[:register_instructions]).to eq(nil)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with regular platforms' do
|
|
|
|
let(:platform) { 'linux' }
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
it 'returns install and register instructions' do
|
|
|
|
expect(resolve_subject.keys).to contain_exactly(:install_instructions, :register_instructions)
|
|
|
|
expect(resolve_subject.values).not_to include(nil)
|
2021-01-29 00:20:46 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|