diff options
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index e605720a2dd..35a4418ebb3 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -676,18 +676,15 @@ describe MergeRequest, models: true do describe "#environments" do let(:project) { create(:project) } - - let!(:deployment) do - create(:deployment, environment: environment, - sha: '5f923865dde3436854e9ceb9cdb7815618d4e849') - end - 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 |