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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-13 14:27:01 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-13 14:27:01 +0300
commit48d43608b8e9118033c1701c98f330aa10f9eb54 (patch)
tree935a75bb921a3ef90efd035b8307283a02a07228 /spec
parent2011f8f1c2b4788df04fd76dcab816ab337e9e08 (diff)
Refine build stop/play extended status specs
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ci/status/build/play_spec.rb27
-rw-r--r--spec/lib/gitlab/ci/status/build/stop_spec.rb35
2 files changed, 31 insertions, 31 deletions
diff --git a/spec/lib/gitlab/ci/status/build/play_spec.rb b/spec/lib/gitlab/ci/status/build/play_spec.rb
index ae103d8993d..180a2808a42 100644
--- a/spec/lib/gitlab/ci/status/build/play_spec.rb
+++ b/spec/lib/gitlab/ci/status/build/play_spec.rb
@@ -1,30 +1,26 @@
require 'spec_helper'
describe Gitlab::Ci::Status::Build::Play do
- let(:core_status) { double('core status') }
+ let(:status) { double('core') }
let(:user) { double('user') }
- subject do
- described_class.new(core_status)
- end
+ subject { described_class.new(status) }
describe '#text' do
- it { expect(subject.text).to eq 'play' }
+ it { expect(subject.text).to eq 'manual' }
end
describe '#label' do
- it { expect(subject.label).to eq 'play' }
+ it { expect(subject.label).to eq 'manual play action' }
end
describe '#icon' do
- it 'does not override core status icon' do
- expect(core_status).to receive(:icon)
-
- subject.icon
- end
+ it { expect(subject.icon).to eq 'icon_status_manual' }
end
describe '.matches?' do
+ subject { described_class.matches?(build, user) }
+
context 'build is playable' do
context 'when build stops an environment' do
let(:build) do
@@ -32,8 +28,7 @@ describe Gitlab::Ci::Status::Build::Play do
end
it 'does not match' do
- expect(described_class.matches?(build, user))
- .to be false
+ expect(subject).to be false
end
end
@@ -41,8 +36,7 @@ describe Gitlab::Ci::Status::Build::Play do
let(:build) { create(:ci_build, :playable) }
it 'is a correct match' do
- expect(described_class.matches?(build, user))
- .to be true
+ expect(subject).to be true
end
end
end
@@ -51,8 +45,7 @@ describe Gitlab::Ci::Status::Build::Play do
let(:build) { create(:ci_build) }
it 'does not match' do
- expect(described_class.matches?(build, user))
- .to be false
+ expect(subject).to be false
end
end
end
diff --git a/spec/lib/gitlab/ci/status/build/stop_spec.rb b/spec/lib/gitlab/ci/status/build/stop_spec.rb
index f2121210417..bc1939fb493 100644
--- a/spec/lib/gitlab/ci/status/build/stop_spec.rb
+++ b/spec/lib/gitlab/ci/status/build/stop_spec.rb
@@ -1,30 +1,40 @@
require 'spec_helper'
describe Gitlab::Ci::Status::Build::Stop do
- let(:core_status) { double('core status') }
+ let(:status) { double('core status') }
let(:user) { double('user') }
subject do
- described_class.new(core_status)
+ described_class.new(status)
end
describe '#text' do
- it { expect(subject.text).to eq 'stop' }
+ it { expect(subject.text).to eq 'manual' }
end
describe '#label' do
- it { expect(subject.label).to eq 'stop' }
+ it { expect(subject.label).to eq 'manual stop action' }
end
describe '#icon' do
- it 'does not override core status icon' do
- expect(core_status).to receive(:icon)
+ it { expect(subject.icon).to eq 'icon_status_manual' }
+ end
- subject.icon
- end
+ describe '#has_action?' do
+ end
+
+ describe '#action_icon' do
+ end
+
+ describe '#action_path' do
+ end
+
+ describe '#action_title' do
end
describe '.matches?' do
+ subject { described_class.matches?(build, user) }
+
context 'build is playable' do
context 'when build stops an environment' do
let(:build) do
@@ -32,8 +42,7 @@ describe Gitlab::Ci::Status::Build::Stop do
end
it 'is a correct match' do
- expect(described_class.matches?(build, user))
- .to be true
+ expect(subject).to be true
end
end
@@ -41,8 +50,7 @@ describe Gitlab::Ci::Status::Build::Stop do
let(:build) { create(:ci_build, :playable) }
it 'does not match' do
- expect(described_class.matches?(build, user))
- .to be false
+ expect(subject).to be false
end
end
end
@@ -51,8 +59,7 @@ describe Gitlab::Ci::Status::Build::Stop do
let(:build) { create(:ci_build) }
it 'does not match' do
- expect(described_class.matches?(build, user))
- .to be false
+ expect(subject).to be false
end
end
end