diff options
author | Robert Speicher <robert@gitlab.com> | 2017-07-28 21:05:58 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-07-28 21:05:58 +0300 |
commit | da967803cce971b184873dbe5d65d07215de0b0a (patch) | |
tree | 46f7eb329794afb3d5139b776ae8a6fcfe1372ab /spec/features | |
parent | 62e9bb16dcac64549b622ad44d984035e643c680 (diff) | |
parent | a2ba403e27183073ad9a4894cfe6c39f94e63964 (diff) |
Merge branch '35599-fix-uncontrolled-default_url_options-overriding' into 'master'
Ensure Gitlab.config.gitlab.host/port and Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
Closes #35599
See merge request !13126
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/dashboard/issues_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/issues/create_branch_merge_request_spec.rb | 10 |
2 files changed, 5 insertions, 17 deletions
diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb index 7c0bf8de14c..82adde6258f 100644 --- a/spec/features/dashboard/issues_spec.rb +++ b/spec/features/dashboard/issues_spec.rb @@ -79,15 +79,7 @@ RSpec.describe 'Dashboard Issues' do end end - it 'shows the new issue page', js: true do - original_defaults = Gitlab::Application.routes.default_url_options - - Gitlab::Application.routes.default_url_options = { - host: Capybara.current_session.server.host, - port: Capybara.current_session.server.port, - protocol: 'http' - } - + it 'shows the new issue page', :js do find('.new-project-item-select-button').trigger('click') wait_for_requests find('.select2-results li').click @@ -97,8 +89,6 @@ RSpec.describe 'Dashboard Issues' do page.within('#content-body') do expect(page).to have_selector('.issue-form') end - - Gitlab::Application.routes.default_url_options = original_defaults end end end diff --git a/spec/features/issues/create_branch_merge_request_spec.rb b/spec/features/issues/create_branch_merge_request_spec.rb index c10b99a4386..f59f687cf51 100644 --- a/spec/features/issues/create_branch_merge_request_spec.rb +++ b/spec/features/issues/create_branch_merge_request_spec.rb @@ -15,16 +15,14 @@ feature 'Create Branch/Merge Request Dropdown on issue page', js: true do visit project_issue_path(project, issue) select_dropdown_option('create-mr') + + expect(page).to have_content('WIP: Resolve "Cherry-Coloured Funk"') + expect(current_path).to eq(project_merge_request_path(project, MergeRequest.first)) - wait_for_requests + visit project_issue_path(project, issue) expect(page).to have_content("created branch 1-cherry-coloured-funk") expect(page).to have_content("mentioned in merge request !1") - - visit project_merge_request_path(project, MergeRequest.first) - - expect(page).to have_content('WIP: Resolve "Cherry-Coloured Funk"') - expect(current_path).to eq(project_merge_request_path(project, MergeRequest.first)) end it 'allows creating a branch from the issue page' do |