Commit bfd9bbba authored by Phil Hughes's avatar Phil Hughes

Added specs for merge request environment list

Ported from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1154
parent 7dc8b6b2
...@@ -5,30 +5,53 @@ describe 'Merge request', :feature, :js do ...@@ -5,30 +5,53 @@ 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
visit new_namespace_project_merge_request_path( context 'new merge request' do
project.namespace, before do
project, visit new_namespace_project_merge_request_path(
merge_request: { project.namespace,
source_project_id: project.id, project,
target_project_id: project.id, merge_request: {
source_branch: 'feature', source_project_id: project.id,
target_branch: 'master' target_project_id: project.id,
} source_branch: 'feature',
) target_branch: 'master'
}
)
end
it 'shows widget status after creating new merge request' do
click_button 'Submit merge request'
expect(find('.mr-state-widget')).to have_content('Checking ability to merge automatically')
wait_for_ajax
expect(page).to have_selector('.accept_merge_request')
end
end end
it 'shows widget status after creating new merge request' do context 'view merge request' do
click_button 'Submit merge request' let!(:environment) { create(:environment, project: project) }
let!(:deployment) { create(:deployment, environment: environment, ref: 'feature', sha: merge_request.diff_head_sha) }
expect(find('.mr-state-widget')).to have_content('Checking ability to merge automatically') before do
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
wait_for_ajax it 'shows environments link' do
wait_for_ajax
expect(page).to have_selector('.accept_merge_request') 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 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