diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-12 20:31:16 +0100 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-11-12 20:31:22 +0100 |
commit | c739b8e0d6258276100da68c2ba1e2ecb7e8bde1 (patch) | |
tree | ccd9d73a709f7551f124f72d580bdd8c0ab23f90 | |
parent | bb8d0e7c59f53e9a4659412e960accc2d80a9406 (diff) | |
download | gitlab-ce-c739b8e0d6258276100da68c2ba1e2ecb7e8bde1.tar.gz |
Just fix (hack) specs
-rw-r--r-- | spec/models/ci/build_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/environment_status_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/update_deployment_service_spec.rb | 12 | ||||
-rw-r--r-- | spec/support/helpers/cycle_analytics_helpers.rb | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 6849bc6db7a..9918c4ba776 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -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 } diff --git a/spec/models/environment_status_spec.rb b/spec/models/environment_status_spec.rb index 90f7e4a4590..27c0d09914a 100644 --- a/spec/models/environment_status_spec.rb +++ b/spec/models/environment_status_spec.rb @@ -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 } diff --git a/spec/services/update_deployment_service_spec.rb b/spec/services/update_deployment_service_spec.rb index 3c55dd9659a..124ad6e7581 100644 --- a/spec/services/update_deployment_service_spec.rb +++ b/spec/services/update_deployment_service_spec.rb @@ -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 diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index ecefdc23811..0b6c7328c6e 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -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) |