summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/dispatcher.js2
-rw-r--r--app/views/projects/snippets/show.html.haml2
-rw-r--r--spec/features/projects/snippets_spec.rb13
3 files changed, 5 insertions, 12 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index f4a30f7d393..88b4b567fa9 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -226,6 +226,8 @@ import initSettingsPanels from './settings_panels';
case 'projects:snippets:edit':
case 'projects:snippets:create':
case 'projects:snippets:update':
+ new gl.GLForm($('.snippet-form'), true);
+ break;
case 'snippets:new':
case 'snippets:edit':
case 'snippets:create':
diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml
index 37b114e7a3a..847f3c2f348 100644
--- a/app/views/projects/snippets/show.html.haml
+++ b/app/views/projects/snippets/show.html.haml
@@ -9,4 +9,4 @@
.row-content-block.top-block.content-component-block
= render 'award_emoji/awards_block', awardable: @snippet, inline: true
- #notes= render "shared/notes/notes_with_form", :autocomplete => false
+ #notes= render "shared/notes/notes_with_form", :autocomplete => true
diff --git a/spec/features/projects/snippets_spec.rb b/spec/features/projects/snippets_spec.rb
index da46b950440..60d7f7455a0 100644
--- a/spec/features/projects/snippets_spec.rb
+++ b/spec/features/projects/snippets_spec.rb
@@ -33,20 +33,11 @@ describe 'Project snippets', :js, feature: true do
visit namespace_project_snippet_path(project.namespace, project, snippets[0])
end
- it 'should not have autocomplete' do
- wait_for_requests
- request_count_before = page.driver.network_traffic.count
-
+ it 'should have autocomplete' do
find('#note_note').native.send_keys('')
fill_in 'note[note]', with: '@'
- wait_for_requests
- request_count_after = page.driver.network_traffic.count
-
- # This selector probably won't be in place even if autocomplete was enabled
- # but we want to make sure
- expect(page).not_to have_selector('.atwho-view')
- expect(request_count_before).to eq(request_count_after)
+ expect(page).to have_selector('.atwho-view')
end
end
end