summaryrefslogtreecommitdiff
path: root/spec/models/environment_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r--spec/models/environment_spec.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb
index 25d6597084c..c65e0b81451 100644
--- a/spec/models/environment_spec.rb
+++ b/spec/models/environment_spec.rb
@@ -170,8 +170,8 @@ describe Environment do
end
end
- describe '#stop_action?' do
- subject { environment.stop_action? }
+ describe '#stop_action_available?' do
+ subject { environment.stop_action_available? }
context 'when no other actions' do
it { is_expected.to be_falsey }
@@ -179,8 +179,17 @@ describe Environment do
context 'when matching action is defined' do
let(:build) { create(:ci_build) }
- let!(:deployment) { create(:deployment, environment: environment, deployable: build, on_stop: 'close_app') }
- let!(:close_action) { create(:ci_build, :manual, pipeline: build.pipeline, name: 'close_app') }
+
+ let!(:deployment) do
+ create(:deployment, environment: environment,
+ deployable: build,
+ on_stop: 'close_app')
+ end
+
+ let!(:close_action) do
+ create(:ci_build, :manual, pipeline: build.pipeline,
+ name: 'close_app')
+ end
context 'when environment is available' do
before do
@@ -562,7 +571,7 @@ describe Environment do
it "is not regenerated if name changes" do
original_slug = environment.slug
- environment.update_attributes!(name: environment.name.reverse)
+ environment.update!(name: environment.name.reverse)
expect(environment.slug).to eq(original_slug)
end