summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-04-26 09:35:58 +0100
committerPhil Hughes <me@iamphill.com>2016-04-26 09:35:58 +0100
commit3e40b88547b97dc7937b93882d2f959c39ef5f31 (patch)
treec2819849561ebb55d35473e5f125b46e842ba733
parent6ff740ff9484691750f3eadf12125fd362efe61c (diff)
downloadgitlab-ce-3e40b88547b97dc7937b93882d2f959c39ef5f31.tar.gz
Project title dropdown testsproject-dropdown-tests
Added a test for when on an issue page to check whether the project dropdown links will still work See !3870
-rw-r--r--spec/features/projects_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index 782c0bfe666..9dd0378d165 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -104,6 +104,33 @@ feature 'Project', feature: true do
end
end
+ describe 'project title' do
+ let(:user) { create(:user) }
+ let(:project) { create(:project, namespace: user.namespace) }
+ let(:project2) { create(:project, namespace: user.namespace, path: 'test') }
+ let(:issue) { create(:issue, project: project) }
+
+ context 'on issues page', js: true do
+ before do
+ login_with(user)
+ project.team.add_user(user, Gitlab::Access::MASTER)
+ project2.team.add_user(user, Gitlab::Access::MASTER)
+ visit namespace_project_issue_path(project.namespace, project, issue)
+ end
+
+ it 'click toggle and show dropdown' do
+ find('.js-projects-dropdown-toggle').click
+ expect(page).to have_css('.dropdown-menu-projects .dropdown-content li', count: 2)
+
+ page.within '.dropdown-menu-projects' do
+ click_link project.name_with_namespace
+ end
+
+ expect(page).to have_content project.name
+ end
+ end
+ end
+
def remove_with_confirm(button_text, confirm_with)
click_button button_text
fill_in 'confirm_name_input', with: confirm_with