Commit 13cee6d7 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix test failures

parent 10499677
...@@ -8,7 +8,7 @@ module Ci ...@@ -8,7 +8,7 @@ module Ci
delegate :project, to: :pipeline delegate :project, to: :pipeline
def initialize(pipeline, name: name, status: nil) def initialize(pipeline, name:, status: nil)
@pipeline, @name, @status = pipeline, name, status @pipeline, @name, @status = pipeline, name, status
end end
...@@ -25,11 +25,11 @@ module Ci ...@@ -25,11 +25,11 @@ module Ci
end end
def statuses def statuses
@statuses ||= pipeline.statuses.where(stage: stage) @statuses ||= pipeline.statuses.where(stage: name)
end end
def builds def builds
@builds ||= pipeline.builds.where(stage: stage) @builds ||= pipeline.builds.where(stage: name)
end end
end end
end end
...@@ -10,8 +10,8 @@ module Gitlab ...@@ -10,8 +10,8 @@ module Gitlab
def details_path def details_path
namespace_project_pipeline_path(@subject.project.namespace, namespace_project_pipeline_path(@subject.project.namespace,
@subject.project, @subject.project,
@subject, @subject.pipeline,
anchor: subject.name) anchor: @subject.name)
end end
def has_action? def has_action?
......
...@@ -2,11 +2,11 @@ require 'spec_helper' ...@@ -2,11 +2,11 @@ require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Common do describe Gitlab::Ci::Status::Stage::Common do
let(:pipeline) { create(:ci_pipeline) } let(:pipeline) { create(:ci_pipeline) }
let(:stage) { Ci::Stage.new(pipeline, 'test') } let(:stage) { Ci::Stage.new(pipeline, name: 'test') }
subject do subject do
Class.new(Gitlab::Ci::Status::Core) Class.new(Gitlab::Ci::Status::Core)
.new(pipeline).extend(described_class) .new(stage).extend(described_class)
end end
it 'does not have action' do it 'does not have action' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Factory do describe Gitlab::Ci::Status::Stage::Factory do
let(:pipeline) { create(:ci_pipeline) } let(:pipeline) { create(:ci_pipeline) }
let(:stage) { Ci::Stage.new(pipeline, 'test') } let(:stage) { Ci::Stage.new(pipeline, name: 'test') }
subject do subject do
described_class.new(stage) described_class.new(stage)
...@@ -15,7 +15,9 @@ describe Gitlab::Ci::Status::Stage::Factory do ...@@ -15,7 +15,9 @@ describe Gitlab::Ci::Status::Stage::Factory do
context 'when stage has a core status' do context 'when stage has a core status' do
HasStatus::AVAILABLE_STATUSES.each do |core_status| HasStatus::AVAILABLE_STATUSES.each do |core_status|
context "when core status is #{core_status}" do context "when core status is #{core_status}" do
let(:build) { create(:ci_build, pipeline: pipeline, stage: stage.name, status: core_status) } let!(:build) do
create(:ci_build, pipeline: pipeline, stage: 'test', status: core_status)
end
it "fabricates a core status #{core_status}" do it "fabricates a core status #{core_status}" do
expect(status).to be_a( expect(status).to be_a(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment