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
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
......
FactoryGirl.define do
factory :deployment, class: Deployment do
sha 'b83d6e391c22777fca1ed3012fce84f633d7fed0'
sha '97de212e80737a608d939f648d959671fb0a0142'
ref 'master'
tag false
project
project nil
environment factory: :environment
......
......@@ -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
......
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