diff --git a/app/controllers/admin/submissions_controller.rb b/app/controllers/admin/submissions_controller.rb
index 6a1e5a005..6cef38022 100644
--- a/app/controllers/admin/submissions_controller.rb
+++ b/app/controllers/admin/submissions_controller.rb
@@ -67,7 +67,7 @@ def add_tag
if !tag.strip.empty? && !@submission.tags.include?(tag)
unique_tags = (@submission.tags.clone << tag.strip.downcase).uniq
- @submission.update(tags: unique_tags)
+ @submission.update_attribute(:tags, unique_tags)
@submission.form.update_submission_tags!(@submission.tags)
end
end
diff --git a/app/views/admin/submissions/_tags.html.erb b/app/views/admin/submissions/_tags.html.erb
index 3bac85d9a..ffe34b24c 100644
--- a/app/views/admin/submissions/_tags.html.erb
+++ b/app/views/admin/submissions/_tags.html.erb
@@ -1,12 +1,12 @@
<%= form_with(model: submission, url: admin_form_submission_path(submission.form, submission), local: true) do |f| %>
-
+
Tags
<%= link_to "https://github.com/gsa/touchpoints/wiki/tagging-responses", target: "_blank", rel: "noopener" do %>
<% end %>
-
+
<% submission.tags.sort.each do |tag| %>
@@ -26,8 +26,7 @@
<% @unused_tags = @form.submission_tags - submission.tags %>
<% if @unused_tags.present? %>
-
-
+
<% @unused_tags.each do |tag| %>
<%= tag %>
diff --git a/spec/features/admin/submissions_spec.rb b/spec/features/admin/submissions_spec.rb
index 85e35f79b..893de8d4f 100644
--- a/spec/features/admin/submissions_spec.rb
+++ b/spec/features/admin/submissions_spec.rb
@@ -133,14 +133,22 @@
it 'adds a tag' do
fill_in 'submission_tag_list', with: 'tag1'
find('#submission_tag_list').native.send_key :tab
- expect(page).to have_content('TAG1')
+ within(".tag-list.applied") do
+ expect(page).to have_content('TAG1')
+ end
+ visit page.current_path
+ within(".tag-list.applied") do
+ expect(page).to have_content('TAG1')
+ end
end
it 'adds multiple tags' do
fill_in 'submission_tag_list', with: 'tag1, tag2'
find('#submission_tag_list').native.send_key :tab
- expect(page).to have_content('TAG1')
- expect(page).to have_content('TAG2')
+ within(".tag-list.applied") do
+ expect(page).to have_content('TAG1')
+ expect(page).to have_content('TAG2')
+ end
end
it 'removes a tag' do