summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 12:54:10 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 13:27:00 +0100
commit573921cb9d0b139dec324fb1368feb1347b51624 (patch)
tree048c3f8a4c05127a0fc1be1de6ad60b6165bcb32 /spec/serializers
parentf1e9c97d64b96bdd398616743ad048f8d147e26b (diff)
downloadgitlab-ce-573921cb9d0b139dec324fb1368feb1347b51624.tar.gz
Implement entities needed for environments folders
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/environment_serializer_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb
index cd9486111f1..f7de6c450ab 100644
--- a/spec/serializers/environment_serializer_spec.rb
+++ b/spec/serializers/environment_serializer_spec.rb
@@ -2,17 +2,25 @@ require 'spec_helper'
describe EnvironmentSerializer do
let(:serializer) do
- described_class.new(path: 'some path', user: user)
+ described_class
+ .new(user: user, project: project)
.represent(resource)
end
let(:user) { create(:user) }
context 'when there is a single object provided' do
- let(:resource) { create(:environment) }
+ let(:deployment) do
+ create(:deployment, deployable: deployable,
+ user: user)
+ end
+
+ let(:deployable) { create(:ci_build) }
+ let(:project) { deployment.project }
+ let(:resource) { deployment.environment }
it 'shows json' do
- puts serializer.as_json
+ pp serializer.as_json
end
it 'it generates payload for single object' do
@@ -21,6 +29,7 @@ describe EnvironmentSerializer do
end
context 'when there is a collection of objects provided' do
+ let(:project) { create(:empty_project) }
let(:resource) { create_list(:environment, 2) }
it 'shows json' do