diff options
Diffstat (limited to 'spec/lib/gitlab/ci')
6 files changed, 27 insertions, 21 deletions
diff --git a/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb b/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb index 73c3cad88bc..243c6f06324 100644 --- a/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb +++ b/spec/lib/gitlab/ci/build/artifacts/metadata/entry_spec.rb @@ -152,6 +152,7 @@ describe Gitlab::Ci::Build::Artifacts::Metadata::Entry do describe '#blob' do let(:file_entry) { |example| path(example) } + subject { file_entry.blob } it 'returns a blob representing the entry data' do diff --git a/spec/lib/gitlab/ci/status/build/factory_spec.rb b/spec/lib/gitlab/ci/status/build/factory_spec.rb index de489fa4664..11be17bfc53 100644 --- a/spec/lib/gitlab/ci/status/build/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/build/factory_spec.rb @@ -31,10 +31,10 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'passed' + expect(status.text).to eq s_('CiStatusText|passed') expect(status.icon).to eq 'status_success' expect(status.favicon).to eq 'favicon_status_success' - expect(status.label).to eq 'passed' + expect(status.label).to eq s_('CiStatusLabel|passed') expect(status).to have_details expect(status).to have_action end @@ -58,10 +58,10 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'passed' + expect(status.text).to eq s_('CiStatusText|passed') expect(status.icon).to eq 'status_success' expect(status.favicon).to eq 'favicon_status_success' - expect(status.label).to eq 'passed' + expect(status.label).to eq s_('CiStatusLabel|passed') expect(status).to have_details expect(status).to have_action end @@ -86,11 +86,11 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'failed' + expect(status.text).to eq s_('CiStatusText|failed') expect(status.icon).to eq 'status_failed' expect(status.favicon).to eq 'favicon_status_failed' - expect(status.label).to eq 'failed' - expect(status.status_tooltip).to eq 'failed - (unknown failure)' + expect(status.label).to eq s_('CiStatusLabel|failed') + expect(status.status_tooltip).to eq "#{s_('CiStatusText|failed')} - (unknown failure)" expect(status).to have_details expect(status).to have_action end @@ -115,7 +115,7 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'failed' + expect(status.text).to eq s_('CiStatusText|failed') expect(status.icon).to eq 'status_warning' expect(status.favicon).to eq 'favicon_status_failed' expect(status.label).to eq 'failed (allowed to fail)' @@ -144,10 +144,10 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'failed' + expect(status.text).to eq s_('CiStatusText|failed') expect(status.icon).to eq 'status_failed' expect(status.favicon).to eq 'favicon_status_failed' - expect(status.label).to eq 'failed' + expect(status.label).to eq s_('CiStatusLabel|failed') expect(status).to have_details expect(status).to have_action expect(status.action_title).to include 'Retry' @@ -173,11 +173,11 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'canceled' + expect(status.text).to eq s_('CiStatusText|canceled') expect(status.icon).to eq 'status_canceled' expect(status.favicon).to eq 'favicon_status_canceled' expect(status.illustration).to include(:image, :size, :title) - expect(status.label).to eq 'canceled' + expect(status.label).to eq s_('CiStatusLabel|canceled') expect(status).to have_details expect(status).to have_action end @@ -200,10 +200,10 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'running' + expect(status.text).to eq s_('CiStatus|running') expect(status.icon).to eq 'status_running' expect(status.favicon).to eq 'favicon_status_running' - expect(status.label).to eq 'running' + expect(status.label).to eq s_('CiStatus|running') expect(status).to have_details expect(status).to have_action end @@ -226,11 +226,11 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'pending' + expect(status.text).to eq s_('CiStatusText|pending') expect(status.icon).to eq 'status_pending' expect(status.favicon).to eq 'favicon_status_pending' expect(status.illustration).to include(:image, :size, :title, :content) - expect(status.label).to eq 'pending' + expect(status.label).to eq s_('CiStatusLabel|pending') expect(status).to have_details expect(status).to have_action end @@ -252,11 +252,11 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'skipped' + expect(status.text).to eq s_('CiStatusText|skipped') expect(status.icon).to eq 'status_skipped' expect(status.favicon).to eq 'favicon_status_skipped' expect(status.illustration).to include(:image, :size, :title) - expect(status.label).to eq 'skipped' + expect(status.label).to eq s_('CiStatusLabel|skipped') expect(status).to have_details expect(status).not_to have_action end @@ -282,7 +282,7 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'manual' + expect(status.text).to eq s_('CiStatusText|manual') expect(status.group).to eq 'manual' expect(status.icon).to eq 'status_manual' expect(status.favicon).to eq 'favicon_status_manual' @@ -339,7 +339,7 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'manual' + expect(status.text).to eq s_('CiStatusText|manual') expect(status.group).to eq 'manual' expect(status.icon).to eq 'status_manual' expect(status.favicon).to eq 'favicon_status_manual' @@ -370,7 +370,7 @@ describe Gitlab::Ci::Status::Build::Factory do end it 'fabricates status with correct details' do - expect(status.text).to eq 'delayed' + expect(status.text).to eq s_('CiStatusText|delayed') expect(status.group).to eq 'scheduled' expect(status.icon).to eq 'status_scheduled' expect(status.favicon).to eq 'favicon_status_scheduled' diff --git a/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb b/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb index 876ba712d05..664915ba552 100644 --- a/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb @@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Blocked do describe '.matches?' do let(:user) { double('user') } + subject { described_class.matches?(pipeline, user) } context 'when pipeline is blocked' do diff --git a/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb b/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb index 90b797965b3..aba403de712 100644 --- a/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb @@ -23,6 +23,7 @@ describe Gitlab::Ci::Status::Pipeline::Delayed do describe '.matches?' do let(:user) { double('user') } + subject { described_class.matches?(pipeline, user) } context 'when pipeline is scheduled' do diff --git a/spec/lib/gitlab/ci/trace/section_parser_spec.rb b/spec/lib/gitlab/ci/trace/section_parser_spec.rb index 5e2efe083be..6e8504a1584 100644 --- a/spec/lib/gitlab/ci/trace/section_parser_spec.rb +++ b/spec/lib/gitlab/ci/trace/section_parser_spec.rb @@ -21,6 +21,7 @@ describe Gitlab::Ci::Trace::SectionParser do end let(:lines) { build_lines('') } + subject { described_class.new(lines) } describe '#sections' do diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index fc57341b5bc..6083aac44f5 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -1723,6 +1723,7 @@ module Gitlab describe "Hidden jobs" do let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) } + subject { config_processor.stage_builds_attributes("test") } shared_examples 'hidden_job_handling' do @@ -1767,6 +1768,7 @@ module Gitlab describe "YAML Alias/Anchor" do let(:config_processor) { Gitlab::Ci::YamlProcessor.new(config) } + subject { config_processor.stage_builds_attributes("build") } shared_examples 'job_templates_handling' do |