Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-09-20 22:16:15 +0300
committerRobert Speicher <robert@gitlab.com>2016-09-20 22:16:15 +0300
commitcbb9507cc54f8fcd15af63eb456fd37e27148503 (patch)
tree2d2a53be17b52eb920980490f3cab3f2af309dce /spec
parent52fcb2e731fff2dcc781b81c8f573aaed354a6bb (diff)
parentb66a8203ca66f6a5e70e4c0bfcb07a0385560591 (diff)
Merge branch 'slash-commands-load-fix' into 'master'
Fixed slash commands not loading ## What does this MR do? Fixes an issue with slash commands not working when the autocomplete source is loading & then the new issue button is clicked. This also fixes an issue where the autocomplete source is loaded on pages where it isn't actually needed. ## What are the relevant issue numbers? Closes #21774, #21807 See merge request !6207
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/gfm_autocomplete_load_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/projects/gfm_autocomplete_load_spec.rb b/spec/features/projects/gfm_autocomplete_load_spec.rb
new file mode 100644
index 00000000000..1921ea6d8ae
--- /dev/null
+++ b/spec/features/projects/gfm_autocomplete_load_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'GFM autocomplete loading', feature: true, js: true do
+ let(:project) { create(:project) }
+
+ before do
+ login_as :admin
+
+ visit namespace_project_path(project.namespace, project)
+ end
+
+ it 'does not load on project#show' do
+ expect(evaluate_script('GitLab.GfmAutoComplete.dataSource')).to eq('')
+ end
+
+ it 'loads on new issue page' do
+ visit new_namespace_project_issue_path(project.namespace, project)
+
+ expect(evaluate_script('GitLab.GfmAutoComplete.dataSource')).not_to eq('')
+ end
+end