diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-11-07 14:29:16 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-11-07 14:29:16 +0900 |
commit | 9c811566f85d18bc9eb4a85c6a343cf1bfa4fbd2 (patch) | |
tree | 0d5de6f22917fa5def4e8a9a918bf0bcd5f1d3e4 /spec/models/environment_spec.rb | |
parent | 4eeb51dc71062fa2eac828c6030388d354179efc (diff) | |
download | gitlab-ce-9c811566f85d18bc9eb4a85c6a343cf1bfa4fbd2.tar.gz |
Revert add action column changes
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r-- | spec/models/environment_spec.rb | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 55ec1bc9e90..ac814c85c3c 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -59,22 +59,14 @@ describe Environment do let(:environment) { create(:environment) } let(:sha) { RepoHelpers.sample_commit.id } - context 'when deployment starts environment' do - context 'when deployment has the specified sha' do - let!(:deployment) { create(:deployment, :start, environment: environment, sha: sha) } + context 'when deployment has the specified sha' do + let!(:deployment) { create(:deployment, environment: environment, sha: sha) } - it { is_expected.to eq([environment]) } - end - - context 'when deployment does not have the specified sha' do - let!(:deployment) { create(:deployment, :start, environment: environment, sha: 'abc') } - - it { is_expected.to be_empty } - end + it { is_expected.to eq([environment]) } end - context 'when deployment stops environment' do - let!(:deployment) { create(:deployment, :stop, environment: environment) } + context 'when deployment does not have the specified sha' do + let!(:deployment) { create(:deployment, environment: environment, sha: 'abc') } it { is_expected.to be_empty } end @@ -85,28 +77,20 @@ describe Environment do let(:environment) { create(:environment) } - context 'when the latest deployment is for starting an environment' do - context 'when the latest deployment is successful' do - let!(:deployment) { create(:deployment, :start, :success, environment: environment) } - - it { expect(subject).to be_within(1.second).of(deployment.finished_at) } - end + context 'when the latest deployment is successful' do + let!(:deployment) { create(:deployment, :success, environment: environment) } - context 'when the latest deployment failed' do - let!(:deployment) { create(:deployment, :start, :failed, environment: environment) } - - it { is_expected.to be_nil } - end + it { expect(subject).to be_within(1.second).of(deployment.finished_at) } + end - context 'when the latest deployment is running' do - let!(:deployment) { create(:deployment, :start, :running, environment: environment) } + context 'when the latest deployment failed' do + let!(:deployment) { create(:deployment, :failed, environment: environment) } - it { is_expected.to be_nil } - end + it { is_expected.to be_nil } end - context 'when the latest deployment is for stopping environment' do - let!(:deployment) { create(:deployment, :stop, :success, environment: environment) } + context 'when the latest deployment is running' do + let!(:deployment) { create(:deployment, :running, environment: environment) } it { is_expected.to be_nil } end |