summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-19 20:26:41 +0100
committerPhil Hughes <me@iamphill.com>2016-07-19 20:26:41 +0100
commite5b64f20c730bd6e18af694b2c1503020ba1db51 (patch)
treef197d0b18aa5454ec3729b8a681322d6369575c0
parent896b9c1dc80af349bab9681bb0c668de65151572 (diff)
downloadgitlab-ce-e5b64f20c730bd6e18af694b2c1503020ba1db51.tar.gz
Added ref switcher enter key tests
-rw-r--r--spec/features/projects/ref_switcher_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/projects/ref_switcher_spec.rb b/spec/features/projects/ref_switcher_spec.rb
new file mode 100644
index 00000000000..b3ba40b35af
--- /dev/null
+++ b/spec/features/projects/ref_switcher_spec.rb
@@ -0,0 +1,29 @@
+require 'rails_helper'
+
+feature 'Ref switcher', feature: true, js: true do
+ include WaitForAjax
+ let(:user) { create(:user) }
+ let(:project) { create(:project, :public) }
+
+ before do
+ project.team << [user, :master]
+ login_as(user)
+ visit namespace_project_tree_path(project.namespace, project, 'master')
+ end
+
+ it 'allow user to change ref by enter key' do
+ click_button 'master'
+ wait_for_ajax
+
+ page.within '.project-refs-form' do
+ input = find('input[type="search"]')
+ input.set 'expand'
+
+ input.native.send_keys :down
+ input.native.send_keys :down
+ input.native.send_keys :enter
+
+ expect(page).to have_content 'expand-collapse-files'
+ end
+ end
+end