diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-03 15:13:57 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-03 15:19:07 +0100 |
commit | f203ca5c932cc24787e1c44c5801c15923cd04ab (patch) | |
tree | 09579f2804330bb76d40b028d8d2f52b55f52448 | |
parent | 3c3e61aaca34d1113d3cfb6076462beaf353e739 (diff) | |
download | gitlab-ce-f203ca5c932cc24787e1c44c5801c15923cd04ab.tar.gz |
Fix specs related to deployments and environments
-rw-r--r-- | app/serializers/build_entity.rb | 2 | ||||
-rw-r--r-- | spec/factories/deployments.rb | 4 | ||||
-rw-r--r-- | spec/serializers/environment_serializer_spec.rb | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/app/serializers/build_entity.rb b/app/serializers/build_entity.rb index b37bff0b500..203bd747ad9 100644 --- a/app/serializers/build_entity.rb +++ b/app/serializers/build_entity.rb @@ -13,7 +13,7 @@ class BuildEntity < Grape::Entity end expose :play_url, if: ->(build, _) { build.manual? } do |build| - url_to(:retry_namespace_project_build, build) + url_to(:play_namespace_project_build, build) end private diff --git a/spec/factories/deployments.rb b/spec/factories/deployments.rb index 8c8e5dc54c2..6f24bf58d14 100644 --- a/spec/factories/deployments.rb +++ b/spec/factories/deployments.rb @@ -1,9 +1,9 @@ FactoryGirl.define do factory :deployment, class: Deployment do - sha 'b83d6e391c22777fca1ed3012fce84f633d7fed0' + sha '97de212e80737a608d939f648d959671fb0a0142' ref 'master' tag false - project + project nil environment factory: :environment diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb index 81393beb416..32f144faf54 100644 --- a/spec/serializers/environment_serializer_spec.rb +++ b/spec/serializers/environment_serializer_spec.rb @@ -8,6 +8,7 @@ describe EnvironmentSerializer do end let(:user) { create(:user) } + let(:project) { create(:project) } context 'when there is a single object provided' do before do @@ -17,11 +18,12 @@ describe EnvironmentSerializer do let(:deployment) do create(:deployment, deployable: deployable, - user: user) + user: user, + project: project, + sha: project.commit.id) end let(:deployable) { create(:ci_build) } - let(:project) { deployment.project } let(:resource) { deployment.environment } it 'it generates payload for single object' do |