diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-21 22:21:13 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-23 17:11:49 +0900 |
commit | a375d80eb072d62962af9b6f2decf9782cd7ee1f (patch) | |
tree | 4cea31ebfcac1b9dcc42ea51a951588fcecc53ce /spec/serializers | |
parent | 6dcd2d591fa00be027b92e8c0e6b3b129921f4fa (diff) | |
download | gitlab-ce-a375d80eb072d62962af9b6f2decf9782cd7ee1f.tar.gz |
Use detailed_status effectively. Remove unnecesarry context(nest). Add new context in merge_requests_controller_spec.rb and fix a bug. Correct description of spec.
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/build_serializer_spec.rb | 6 | ||||
-rw-r--r-- | spec/serializers/pipeline_serializer_spec.rb | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/spec/serializers/build_serializer_spec.rb b/spec/serializers/build_serializer_spec.rb index 5a55d9d7dc1..3cc791bca50 100644 --- a/spec/serializers/build_serializer_spec.rb +++ b/spec/serializers/build_serializer_spec.rb @@ -29,10 +29,8 @@ describe BuildSerializer do describe '#represent_status' do context 'when represents only status' do - let(:status) do - Gitlab::Ci::Status::Success.new(double('object'), double('user')) - end - let(:resource) { create(:ci_build, status: :success) } + let(:resource) { create(:ci_build) } + let(:status) { resource.detailed_status(double('user')) } subject { serializer.represent_status(resource) } diff --git a/spec/serializers/pipeline_serializer_spec.rb b/spec/serializers/pipeline_serializer_spec.rb index 261f2152c22..8642b803844 100644 --- a/spec/serializers/pipeline_serializer_spec.rb +++ b/spec/serializers/pipeline_serializer_spec.rb @@ -97,10 +97,8 @@ describe PipelineSerializer do describe '#represent_status' do context 'when represents only status' do - let(:status) do - Gitlab::Ci::Status::Success.new(double('object'), double('user')) - end - let(:resource) { create(:ci_pipeline, status: :success) } + let(:resource) { create(:ci_pipeline) } + let(:status) { resource.detailed_status(double('user')) } subject { serializer.represent_status(resource) } |