Commit c739b8e0 authored by Kamil Trzciński's avatar Kamil Trzciński

Just fix (hack) specs

parent bb8d0e7c
......@@ -800,7 +800,7 @@ describe Ci::Build do
end
describe 'state transition as a deployable' do
let!(:build) { create(:ci_build, :start_review_app) }
let!(:build) { create(:ci_build, :start_review_app).reload }
let(:deployment) { build.deployment }
let(:environment) { deployment.environment }
......
......@@ -94,7 +94,7 @@ describe EnvironmentStatus do
describe '.build_environments_status' do
subject { described_class.send(:build_environments_status, merge_request, user, sha) }
let!(:build) { create(:ci_build, :deploy_to_production, pipeline: pipeline) }
let!(:build) { create(:ci_build, :deploy_to_production, pipeline: pipeline).reload }
let(:environment) { build.deployment.environment }
let(:user) { project.owner }
......
......@@ -10,7 +10,7 @@ describe UpdateDeploymentService do
tag: false,
environment: 'production',
options: { environment: options },
project: project)
project: project).reload
end
let(:project) { create(:project, :repository) }
......@@ -99,7 +99,7 @@ describe UpdateDeploymentService do
ref: 'master',
environment: 'production',
project: project,
options: { environment: { name: 'production', url: 'http://review/$CI_COMMIT_REF_NAME' } })
options: { environment: { name: 'production', url: 'http://review/$CI_COMMIT_REF_NAME' } }).reload
end
it { is_expected.to eq('http://review/master') }
......@@ -111,7 +111,7 @@ describe UpdateDeploymentService do
ref: 'master',
environment: 'prod-slug',
project: project,
options: { environment: { name: 'prod-slug', url: 'http://review/$CI_ENVIRONMENT_SLUG' } })
options: { environment: { name: 'prod-slug', url: 'http://review/$CI_ENVIRONMENT_SLUG' } }).reload
end
it { is_expected.to eq('http://review/prod-slug') }
......@@ -123,14 +123,14 @@ describe UpdateDeploymentService do
yaml_variables: [{ key: :APP_HOST, value: 'host' }],
environment: 'production',
project: project,
options: { environment: { name: 'production', url: 'http://review/$APP_HOST' } })
options: { environment: { name: 'production', url: 'http://review/$APP_HOST' } }).reload
end
it { is_expected.to eq('http://review/host') }
end
context 'when yaml environment does not have url' do
let(:job) { create(:ci_build, environment: 'staging', project: project) }
let(:job) { create(:ci_build, environment: 'staging', project: project).reload }
it 'returns the external_url from persisted environment' do
is_expected.to be_nil
......@@ -160,7 +160,7 @@ describe UpdateDeploymentService do
tag: false,
environment: 'staging',
options: { environment: { name: 'staging' } },
project: project)
project: project).reload
end
it "doesn't set the time if the deploy's environment is not 'production'" do
......
......@@ -115,7 +115,7 @@ module CycleAnalyticsHelpers
name: 'dummy',
stage: 'dummy',
pipeline: dummy_pipeline(project),
protected: false)
protected: false).reload
end
def mock_gitaly_multi_action_dates(repository, commit_time)
......
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