summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-14 10:21:16 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-14 10:21:16 +0100
commitac115a9e1f106863112ca9daf463a8f5b8db7d0a (patch)
treeb0699a35af173c106e60835684b4086ad4adafa5 /spec
parent309580bd41a178a02894d399e3cd45659a8ba7a7 (diff)
downloadgitlab-ce-ac115a9e1f106863112ca9daf463a8f5b8db7d0a.tar.gz
Add some missing tests for detailed status methodsbuild-statuses
Diffstat (limited to 'spec')
-rw-r--r--spec/models/build_spec.rb9
-rw-r--r--spec/models/commit_status_spec.rb9
-rw-r--r--spec/models/generic_commit_status_spec.rb16
3 files changed, 32 insertions, 2 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index ac596ce4a91..7f39aff7639 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -1246,4 +1246,13 @@ describe Ci::Build, models: true do
it { is_expected.to eq('review/master') }
end
end
+
+ describe '#detailed_status' do
+ let(:user) { create(:user) }
+
+ it 'returns a detailed status' do
+ expect(build.detailed_status(user))
+ .to be_a Gitlab::Ci::Status::Build::Cancelable
+ end
+ end
end
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb
index 1ec08c2a9d0..701f3323c0f 100644
--- a/spec/models/commit_status_spec.rb
+++ b/spec/models/commit_status_spec.rb
@@ -234,4 +234,13 @@ describe CommitStatus, models: true do
end
end
end
+
+ describe '#detailed_status' do
+ let(:user) { create(:user) }
+
+ it 'returns a detailed status' do
+ expect(commit_status.detailed_status(user))
+ .to be_a Gitlab::Ci::Status::Success
+ end
+ end
end
diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb
index 615cfe3142b..6004bfdb7b7 100644
--- a/spec/models/generic_commit_status_spec.rb
+++ b/spec/models/generic_commit_status_spec.rb
@@ -1,8 +1,11 @@
require 'spec_helper'
describe GenericCommitStatus, models: true do
- let(:pipeline) { FactoryGirl.create :ci_pipeline }
- let(:generic_commit_status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
+ let(:pipeline) { create(:ci_pipeline) }
+
+ let(:generic_commit_status) do
+ create(:generic_commit_status, pipeline: pipeline)
+ end
describe '#context' do
subject { generic_commit_status.context }
@@ -17,6 +20,15 @@ describe GenericCommitStatus, models: true do
it { is_expected.to eq([:external]) }
end
+ describe '#detailed_status' do
+ let(:user) { create(:user) }
+
+ it 'returns detailed status object' do
+ expect(generic_commit_status.detailed_status(user))
+ .to be_a Gitlab::Ci::Status::Success
+ end
+ end
+
describe 'set_default_values' do
before do
generic_commit_status.context = nil