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

smoke_spec.rb « instance « test « scenario « spec « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e79d19e821211bb99b54a06b62ee58f87f8ee7c0 (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
36
37
38
39
40
41
42
43
44
45
describe QA::Scenario::Test::Instance::Smoke do
  subject { Class.new(described_class) { tags :smoke } }

  context '#perform' do
    let(:arguments) { spy('Runtime::Scenario') }
    let(:release) { spy('Runtime::Release') }
    let(:runner) { spy('Specs::Runner') }

    before do
      stub_const('QA::Runtime::Release', release)
      stub_const('QA::Runtime::Scenario', arguments)
      stub_const('QA::Specs::Runner', runner)

      allow(runner).to receive(:perform).and_yield(runner)
    end

    it 'sets an address of the subject' do
      subject.perform("hello")

      expect(arguments).to have_received(:define)
        .with(:gitlab_address, "hello")
    end

    it 'has a smoke tag' do
      expect(subject.focus).to eq([:smoke]) # rubocop:disable Focus
    end

    context 'no paths' do
      it 'calls runner with default arguments' do
        subject.perform("test")

        expect(runner).to have_received(:options=)
          .with(::File.expand_path('../../../../qa/specs/features', __dir__))
      end
    end

    context 'specifying paths' do
      it 'calls runner with paths' do
        subject.perform('test', 'path1', 'path2')

        expect(runner).to have_received(:options=).with(%w[path1 path2])
      end
    end
  end
end