summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-04 10:16:30 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-04 10:16:30 +0100
commita2c1178c21796933916bb44b3d6b8e4d11d89d7f (patch)
treee8f184888b66c16db9a65b0c66aab704387a00d1 /spec
parentf203ca5c932cc24787e1c44c5801c15923cd04ab (diff)
downloadgitlab-ce-a2c1178c21796933916bb44b3d6b8e4d11d89d7f.tar.gz
Expose commit author if author exists
Diffstat (limited to 'spec')
-rw-r--r--spec/serializers/environment_serializer_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb
index 32f144faf54..37bc086826c 100644
--- a/spec/serializers/environment_serializer_spec.rb
+++ b/spec/serializers/environment_serializer_spec.rb
@@ -7,6 +7,7 @@ describe EnvironmentSerializer do
.represent(resource)
end
+ let(:json) { serializer.as_json }
let(:user) { create(:user) }
let(:project) { create(:project) }
@@ -27,16 +28,16 @@ describe EnvironmentSerializer do
let(:resource) { deployment.environment }
it 'it generates payload for single object' do
- expect(serializer.as_json).to be_an_instance_of Hash
+ expect(json).to be_an_instance_of Hash
end
it 'contains important elements of environment' do
- expect(serializer.as_json)
+ expect(json)
.to include(:name, :external_url, :environment_url, :last_deployment)
end
it 'contains relevant information about last deployment' do
- last_deployment = serializer.as_json.fetch(:last_deployment)
+ last_deployment = json.fetch(:last_deployment)
expect(last_deployment)
.to include(:ref, :user, :commit, :deployable, :manual_actions)
@@ -48,12 +49,12 @@ describe EnvironmentSerializer do
let(:resource) { create_list(:environment, 2) }
it 'contains important elements of environment' do
- expect(serializer.as_json.first)
+ expect(json.first)
.to include(:last_deployment, :name, :external_url)
end
it 'generates payload for collection' do
- expect(serializer.as_json).to be_an_instance_of Array
+ expect(json).to be_an_instance_of Array
end
end
end