diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-08-17 01:59:19 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-08-17 01:59:19 +0300 |
commit | 1d3aa59f99a72f613b84286eef948dfbad20925e (patch) | |
tree | 0061000ff2226f3bc4e88ce8133a65403de9f37e /spec/models/merge_request_spec.rb | |
parent | 1e7cbe0b05ddd9c72987730323e63d612d429ab9 (diff) | |
parent | 76aa85cc8023e1a8176f0b783a52154f98a5be8f (diff) |
Merge branch 'master' into diff-line-comment-vuejs
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 4ba6a175e77..b9bec76fdbd 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -674,6 +674,21 @@ describe MergeRequest, models: true do end end + describe "#environments" do + let(:project) { create(:project) } + let!(:environment) { create(:environment, project: project) } + let!(:environment1) { create(:environment, project: project) } + let!(:environment2) { create(:environment, project: project) } + let(:merge_request) { create(:merge_request, source_project: project) } + + it 'selects deployed environments' do + create(:deployment, environment: environment, sha: project.commit('master').id) + create(:deployment, environment: environment1, sha: project.commit('feature').id) + + expect(merge_request.environments).to eq [environment] + end + end + describe "#reload_diff" do let(:note) { create(:diff_note_on_merge_request, project: subject.project, noteable: subject) } |