summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-07 16:46:37 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-07 16:46:37 +0100
commite4efb135e810046b1f4283db4dfe1b386ef15bad (patch)
tree4398b740d2f75252b0a425fe2a961de6ee82abfe /spec/serializers
parentad19de19498a1337a242fd67731e59771e65a9d3 (diff)
downloadgitlab-ce-e4efb135e810046b1f4283db4dfe1b386ef15bad.tar.gz
Add status entity prototype and expose in pipeline
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/status_entity_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/serializers/status_entity_spec.rb b/spec/serializers/status_entity_spec.rb
new file mode 100644
index 00000000000..5afa1c25a42
--- /dev/null
+++ b/spec/serializers/status_entity_spec.rb
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe StatusEntity do
+ let(:entity) do
+ described_class.new(status)
+ end
+
+ let(:status) do # TODO, add statuses factory
+ Gitlab::Ci::Status::Success.new(double('object'))
+ end
+
+ before do
+ allow(status).to receive(:has_details?).and_return(true)
+ allow(status).to receive(:details_path).and_return('some/path')
+ end
+
+ subject { entity.as_json }
+
+ it 'contains status details' do
+ expect(subject).to include :text, :icon, :label, :title
+ expect(subject).to include :has_details
+ expect(subject).to include :details_path
+ end
+end