Commit 943b3d0e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Implement the rest of core CI statuses with specs

parent d4ed5b2e
...@@ -16,6 +16,10 @@ module Gitlab::Ci ...@@ -16,6 +16,10 @@ module Gitlab::Ci
raise NotImplementedError raise NotImplementedError
end end
def title
"#{@subject.class.name.demodulize}: #{label}"
end
def has_details? def has_details?
raise NotImplementedError raise NotImplementedError
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Canceled class Canceled < Core::Base
def label
'canceled'
end
def icon
'icon_status_canceled'
end
end end
end end
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Created class Created < Core::Base
def label
'created'
end
def icon
'icon_status_created'
end
end end
end end
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Failed class Failed < Core::Base
def label
'failed'
end
def icon
'icon_status_failed'
end
end end
end end
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Pending class Pending < Core::Base
def label
'pending'
end
def icon
'icon_status_pending'
end
end end
end end
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Running class Running < Core::Base
def label
'running'
end
def icon
'icon_status_running'
end
end end
end end
end end
......
module Gitlab::Ci module Gitlab::Ci
module Status module Status
module Core module Core
class Skipped class Skipped < Core::Base
def label
'skipped'
end
def icon
'icon_status_skipped'
end
end end
end end
end end
......
...@@ -7,7 +7,7 @@ module Gitlab::Ci ...@@ -7,7 +7,7 @@ module Gitlab::Ci
end end
def icon def icon
'success' 'icon_status_success'
end end
end end
end end
......
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Canceled do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'canceled' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_canceled' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: canceled' }
end
end
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Created do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'created' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_created' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: created' }
end
end
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Failed do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'failed' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_failed' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: failed' }
end
end
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Pending do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'pending' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_pending' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: pending' }
end
end
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Running do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'running' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_running' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: running' }
end
end
require 'spec_helper'
describe Gitlab::Ci::Status::Core::Skipped do
subject { described_class.new(double('subject')) }
describe '#label' do
it { expect(subject.label).to eq 'skipped' }
end
describe '#icon' do
it { expect(subject.icon).to eq 'icon_status_skipped' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: skipped' }
end
end
...@@ -8,6 +8,10 @@ describe Gitlab::Ci::Status::Core::Success do ...@@ -8,6 +8,10 @@ describe Gitlab::Ci::Status::Core::Success do
end end
describe '#icon' do describe '#icon' do
it { expect(subject.icon).to eq 'success' } it { expect(subject.icon).to eq 'icon_status_success' }
end
describe '#title' do
it { expect(subject.title).to eq 'Double: passed' }
end end
end end
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