show.html.haml_spec.rb 916 字节
Newer Older
1 2 3 4
require 'spec_helper'

describe 'ci/lints/show' do
  let(:content) do
K
Katarzyna Kobierska 已提交
5 6
    {
      build_template: {
7 8 9 10 11 12 13 14
        script: './build.sh',
        tags: ['dotnet'],
        only: ['test@dude/repo'],
        except: ['deploy'],
        environment: 'testing'
      }
    }
  end
K
Katarzyna Kobierska 已提交
15

16 17
  let(:config_processor) { Ci::GitlabCiYamlProcessor.new(YAML.dump(content)) }

K
Katarzyna Kobierska 已提交
18
  context 'when the content is valid' do
19 20 21 22 23 24
    before do
      assign(:status, true)
      assign(:builds, config_processor.builds)
      assign(:stages, config_processor.stages)
    end

K
Katarzyna Kobierska 已提交
25
    it 'shows the correct values' do
26 27 28 29 30 31 32 33 34 35
      render

      expect(rendered).to have_content('Tag list: dotnet')
      expect(rendered).to have_content('Refs only: test@dude/repo')
      expect(rendered).to have_content('Refs except: deploy')
      expect(rendered).to have_content('Environment: testing')
      expect(rendered).to have_content('When: on_success')
    end
  end
end