diff --git a/spec/features/environments_spec.rb b/spec/features/environments_spec.rb index 7f67ff7df92..7200e9ad4c1 100644 --- a/spec/features/environments_spec.rb +++ b/spec/features/environments_spec.rb @@ -18,7 +18,7 @@ feature 'Environments', feature: true do before do visit namespace_project_environments_path(project.namespace, project) end - + context 'shows two tabs' do scenario 'does show Available tab with link' do expect(page).to have_link('Available') @@ -33,7 +33,7 @@ feature 'Environments', feature: true do scenario 'does show no environments' do expect(page).to have_content('You don\'t have any environments right now.') end - + scenario 'does show 0 as counter for environments in both tabs' do expect(page.find('.js-available-environments-count').text).to eq('0') expect(page.find('.js-stopped-environments-count').text).to eq('0') @@ -46,7 +46,7 @@ feature 'Environments', feature: true do scenario 'does show environment name' do expect(page).to have_link(environment.name) end - + scenario 'does show number of opened environments in Available tab' do expect(page.find('.js-available-environments-count').text).to eq('1') end @@ -67,7 +67,7 @@ feature 'Environments', feature: true do scenario 'does show deployment SHA' do expect(page).to have_link(deployment.short_sha) end - + scenario 'does show deployment internal id' do expect(page).to have_content(deployment.iid) end @@ -88,7 +88,7 @@ feature 'Environments', feature: true do expect(page).to have_content(manual.name) expect(manual.reload).to be_pending end - + scenario 'does show build name and id' do expect(page).to have_link("#{build.name} (##{build.id})") end @@ -100,12 +100,12 @@ feature 'Environments', feature: true do scenario 'does not show external link button' do expect(page).not_to have_css('external-url') end - + context 'with external_url' do given(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') } given(:build) { create(:ci_build, pipeline: pipeline) } given(:deployment) { create(:deployment, environment: environment, deployable: build) } - + scenario 'does show an external link button' do expect(page).to have_link(nil, href: environment.external_url) end @@ -198,7 +198,7 @@ feature 'Environments', feature: true do expect(page).to have_content(manual.name) expect(manual.reload).to be_pending end - + context 'with external_url' do given(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') } given(:build) { create(:ci_build, pipeline: pipeline) } @@ -217,7 +217,7 @@ feature 'Environments', feature: true do expect(page).to have_link('Stop') end - scenario ' scenario 'does allow to stop environment' do' do + scenario 'does allow to stop environment' do click_link('Stop') expect(page).to have_content('close_app') diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb index 6dedd25e9d3..a46ff07f625 100644 --- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb +++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb @@ -754,7 +754,7 @@ module Ci it 'does return production' do expect(builds.size).to eq(1) expect(builds.first[:environment]).to eq(environment) - expect(builds.first[:options]).to include(environment: { name: environment }) + expect(builds.first[:options]).to include(environment: { name: environment, action: "start" }) end end diff --git a/spec/lib/gitlab/ci/config/node/environment_spec.rb b/spec/lib/gitlab/ci/config/node/environment_spec.rb index dbeb28c8aad..df925ff1afd 100644 --- a/spec/lib/gitlab/ci/config/node/environment_spec.rb +++ b/spec/lib/gitlab/ci/config/node/environment_spec.rb @@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Node::Environment do describe '#value' do it 'returns valid hash' do - expect(entry.value).to eq(name: 'production') + expect(entry.value).to include(name: 'production') end end diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index b019f2ddb77..1c1fef57fc4 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -8,7 +8,7 @@ describe Environment, models: true do it { is_expected.to delegate_method(:last_deployment).to(:deployments).as(:last) } - it { is_expected.to delegate_method(:stop_action).to(:last_deployment).as(:last) } + it { is_expected.to delegate_method(:stop_action).to(:last_deployment) } it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_uniqueness_of(:name).scoped_to(:project_id) }