diff options
author | Phil Hughes <me@iamphill.com> | 2016-09-05 18:38:19 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-09-16 12:49:55 +0300 |
commit | a5035ed3108e4c335382c44b24470e4a564270e4 (patch) | |
tree | c98a35569219fe3c21ed13e8542c4fcd929d2906 /spec/features/projects/gfm_autocomplete_load_spec.rb | |
parent | 3531032e162ae78bbf21299d14d8b7cc452625f0 (diff) |
Correctly loads gfm autocomplete source on pages where it is required
Diffstat (limited to 'spec/features/projects/gfm_autocomplete_load_spec.rb')
-rw-r--r-- | spec/features/projects/gfm_autocomplete_load_spec.rb | 23 |
1 files changed, 23 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..18cf2f9d1fb --- /dev/null +++ b/spec/features/projects/gfm_autocomplete_load_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe 'GFM autocomplete loading', feature: true, js: true do + let(:user) { create(:user) } + let(:project) { create(:project) } + + before do + project.team << [user, :master] + login_as user + + 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 |