diff options
author | Robert Speicher <robert@gitlab.com> | 2016-09-20 22:16:15 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-09-20 22:16:15 +0300 |
commit | cbb9507cc54f8fcd15af63eb456fd37e27148503 (patch) | |
tree | 2d2a53be17b52eb920980490f3cab3f2af309dce /spec | |
parent | 52fcb2e731fff2dcc781b81c8f573aaed354a6bb (diff) | |
parent | b66a8203ca66f6a5e70e4c0bfcb07a0385560591 (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.rb | 21 |
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 |