summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-07-25 13:19:06 +0000
committerSimon Knox <psimyn@gmail.com>2017-07-27 11:33:46 +1000
commit06c4a6076562073c0638beaa0c090540c7d02326 (patch)
tree6a8f3c39ff2718c1bda6fa9e684269fe7a3f830c
parent49566f4dec9af2634c4de9bb286377529f99ce99 (diff)
downloadgitlab-ce-06c4a6076562073c0638beaa0c090540c7d02326.tar.gz
Merge branch '35474-fix-new-issue' into 'master'
Move relative_path to the element that is being clicked Closes #35474 See merge request !13079
-rw-r--r--app/views/shared/_new_project_item_select.html.haml4
-rw-r--r--spec/features/dashboard/issues_spec.rb18
2 files changed, 20 insertions, 2 deletions
diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml
index c1acee1a211..5f3cdaefd54 100644
--- a/app/views/shared/_new_project_item_select.html.haml
+++ b/app/views/shared/_new_project_item_select.html.haml
@@ -1,6 +1,6 @@
- if @projects.any?
.project-item-select-holder
- = project_select_tag :project_path, class: "project-item-select", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at' }, with_feature_enabled: local_assigns[:with_feature_enabled]
- %a.btn.btn-new.new-project-item-select-button{ data: { relative_path: local_assigns[:path] } }
+ = project_select_tag :project_path, class: "project-item-select", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path] }, with_feature_enabled: local_assigns[:with_feature_enabled]
+ %a.btn.btn-new.new-project-item-select-button
= local_assigns[:label]
= icon('caret-down')
diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb
index 69c1a2ed89a..2a5ef08da60 100644
--- a/spec/features/dashboard/issues_spec.rb
+++ b/spec/features/dashboard/issues_spec.rb
@@ -78,5 +78,23 @@ RSpec.describe 'Dashboard Issues', feature: true do
expect(page).not_to have_content(project_with_issues_disabled.name_with_namespace)
end
end
+
+ it 'shows the new issue page', js: true do
+ Gitlab::Application.routes.default_url_options = {
+ host: Capybara.current_session.server.host,
+ port: Capybara.current_session.server.port,
+ protocol: 'http'
+ }
+
+ find('.new-project-item-select-button').trigger('click')
+ wait_for_requests
+ find('.select2-results li').click
+
+ expect(page).to have_current_path("/#{project.path_with_namespace}/issues/new")
+
+ page.within('#content-body') do
+ expect(page).to have_selector('.issue-form')
+ end
+ end
end
end