diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 18:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 18:08:01 +0000 |
commit | 8e45d25f7dde6508839ffee719c0ddc2cf6b12d3 (patch) | |
tree | 9839e7fe63b36904d40995ebf519124c9a8f7681 /spec/models/deployment_spec.rb | |
parent | 00c78fb814d7ce00989ac04edd6cdaa3239da284 (diff) | |
download | gitlab-ce-8e45d25f7dde6508839ffee719c0ddc2cf6b12d3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r-- | spec/models/deployment_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb index 51ed8e9421b..3a0b3c46ad0 100644 --- a/spec/models/deployment_spec.rb +++ b/spec/models/deployment_spec.rb @@ -348,4 +348,17 @@ describe Deployment do expect(deployment.deployed_by).to eq(build_user) end end + + describe '.find_successful_deployment!' do + it 'returns a successful deployment' do + deploy = create(:deployment, :success) + + expect(described_class.find_successful_deployment!(deploy.iid)).to eq(deploy) + end + + it 'raises when no deployment is found' do + expect { described_class.find_successful_deployment!(-1) } + .to raise_error(ActiveRecord::RecordNotFound) + end + end end |