diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-15 15:57:35 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-15 15:57:35 +0100 |
commit | ccea4727a6999d6abaea9e7a43bd1e015e43f1d2 (patch) | |
tree | 642dc24083c93ea1fa4eef89e20a108c8429167c /spec | |
parent | c7db5b3efa2e02c580bf60be78780103847e4ba4 (diff) | |
download | gitlab-ce-ccea4727a6999d6abaea9e7a43bd1e015e43f1d2.tar.gz |
Fix pipeline detailed status serializer and entities
Diffstat (limited to 'spec')
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 15 | ||||
-rw-r--r-- | spec/serializers/status_entity_spec.rb | 10 |
2 files changed, 13 insertions, 12 deletions
diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index f6b7d1eb1dd..d85c6ae5ad6 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -1,15 +1,18 @@ require 'spec_helper' describe PipelineSerializer do + let(:user) { create(:user) } + let(:pipeline) { create(:ci_empty_pipeline) } + let(:serializer) do described_class.new(user: user) end - let(:pipelines) do - create_list(:ci_pipeline, 2) - end - - let(:user) { create(:user) } + describe '#represent' do + subject { serializer.represent(pipeline) } - # TODO add some tests here. + it 'serializers the pipeline object' do + expect(subject.as_json).to include :id + end + end end diff --git a/spec/serializers/status_entity_spec.rb b/spec/serializers/status_entity_spec.rb index 5afa1c25a42..c3da61321de 100644 --- a/spec/serializers/status_entity_spec.rb +++ b/spec/serializers/status_entity_spec.rb @@ -1,12 +1,10 @@ require 'spec_helper' describe StatusEntity do - let(:entity) do - described_class.new(status) - end + let(:entity) { described_class.new(status) } - let(:status) do # TODO, add statuses factory - Gitlab::Ci::Status::Success.new(double('object')) + let(:status) do + Gitlab::Ci::Status::Success.new(double('object'), double('user')) end before do @@ -17,7 +15,7 @@ describe StatusEntity do subject { entity.as_json } it 'contains status details' do - expect(subject).to include :text, :icon, :label, :title + expect(subject).to include :text, :icon, :label expect(subject).to include :has_details expect(subject).to include :details_path end |