Commit f203ca5c authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix specs related to deployments and environments

parent 3c3e61aa
...@@ -13,7 +13,7 @@ class BuildEntity < Grape::Entity ...@@ -13,7 +13,7 @@ class BuildEntity < Grape::Entity
end end
expose :play_url, if: ->(build, _) { build.manual? } do |build| expose :play_url, if: ->(build, _) { build.manual? } do |build|
url_to(:retry_namespace_project_build, build) url_to(:play_namespace_project_build, build)
end end
private private
......
FactoryGirl.define do FactoryGirl.define do
factory :deployment, class: Deployment do factory :deployment, class: Deployment do
sha 'b83d6e391c22777fca1ed3012fce84f633d7fed0' sha '97de212e80737a608d939f648d959671fb0a0142'
ref 'master' ref 'master'
tag false tag false
project project nil
environment factory: :environment environment factory: :environment
......
...@@ -8,6 +8,7 @@ describe EnvironmentSerializer do ...@@ -8,6 +8,7 @@ describe EnvironmentSerializer do
end end
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) }
context 'when there is a single object provided' do context 'when there is a single object provided' do
before do before do
...@@ -17,11 +18,12 @@ describe EnvironmentSerializer do ...@@ -17,11 +18,12 @@ describe EnvironmentSerializer do
let(:deployment) do let(:deployment) do
create(:deployment, deployable: deployable, create(:deployment, deployable: deployable,
user: user) user: user,
project: project,
sha: project.commit.id)
end end
let(:deployable) { create(:ci_build) } let(:deployable) { create(:ci_build) }
let(:project) { deployment.project }
let(:resource) { deployment.environment } let(:resource) { deployment.environment }
it 'it generates payload for single object' do it 'it generates payload for single object' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment