Commit 32b82e58 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'merge-request-environment-list-spec' into 'master'

Added specs for merge request environment list

See merge request !8937
parents 707ce837 bfd9bbba
...@@ -5,11 +5,15 @@ describe 'Merge request', :feature, :js do ...@@ -5,11 +5,15 @@ describe 'Merge request', :feature, :js do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) { create(:merge_request, source_project: project) }
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) login_as(user)
end
context 'new merge request' do
before do
visit new_namespace_project_merge_request_path( visit new_namespace_project_merge_request_path(
project.namespace, project.namespace,
project, project,
...@@ -31,4 +35,23 @@ describe 'Merge request', :feature, :js do ...@@ -31,4 +35,23 @@ describe 'Merge request', :feature, :js do
expect(page).to have_selector('.accept_merge_request') expect(page).to have_selector('.accept_merge_request')
end end
end
context 'view merge request' do
let!(:environment) { create(:environment, project: project) }
let!(:deployment) { create(:deployment, environment: environment, ref: 'feature', sha: merge_request.diff_head_sha) }
before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
it 'shows environments link' do
wait_for_ajax
page.within('.mr-widget-heading') do
expect(page).to have_content("Deployed to #{environment.name}")
expect(find('.js-environment-link')[:href]).to include(environment.formatted_external_url)
end
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment