Welcome to mirror list, hosted at ThFree Co, Russian Federation.

runner_setup_resolver_spec.rb « ci « resolvers « graphql « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 13ef89023d9a568d611e3cf74fab87d28fac4c42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Resolvers::Ci::RunnerSetupResolver do
  include GraphqlHelpers

  describe '#resolve' do
    let(:user) { create(:user) }

    subject(:resolve_subject) { resolve(described_class, ctx: { current_user: user }, args: { platform: platform, architecture: 'amd64' }) }

    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' }

      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)
      end
    end
  end
end