<% end %>
<% end %>
diff --git a/app/views/comments/new.js.erb b/app/views/comments/new.js.erb
index 645129c76..819686e72 100644
--- a/app/views/comments/new.js.erb
+++ b/app/views/comments/new.js.erb
@@ -1,2 +1,2 @@
-var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment_body";
+var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment-body-<%= dom_id(@parent) %>";
App.Comments.display_error(field_with_errors, "<%= j render('comments/errors') %>");
diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb
index 0986412bc..9814a4b33 100644
--- a/spec/features/comments_spec.rb
+++ b/spec/features/comments_spec.rb
@@ -59,7 +59,7 @@ feature 'Comments' do
login_as(user)
visit debate_path(debate)
- fill_in 'comment_body', with: 'Have you thought about...?'
+ fill_in "comment-body-debate_#{debate.id}", with: 'Have you thought about...?'
click_button 'Publish comment'
within "#comments" do
@@ -91,7 +91,7 @@ feature 'Comments' do
click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do
- fill_in 'comment_body', with: 'It will be done next week.'
+ fill_in "comment-body-comment_#{comment.id}", with: 'It will be done next week.'
click_button 'Publish reply'
end
@@ -178,8 +178,8 @@ feature 'Comments' do
login_as(moderator.user)
visit debate_path(debate)
- fill_in "comment_body", with: "I am moderating!"
- check "comment_as_moderator"
+ fill_in "comment-body-debate_#{debate.id}", with: "I am moderating!"
+ check "comment-as-moderator-debate_#{debate.id}"
click_button "Publish comment"
within "#comments" do
@@ -203,8 +203,8 @@ feature 'Comments' do
click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do
- fill_in "comment_body", with: "I am moderating!"
- check "comment_as_moderator"
+ fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!"
+ check "comment-as-moderator-comment_#{comment.id}"
click_button 'Publish reply'
end
@@ -237,8 +237,8 @@ feature 'Comments' do
login_as(admin.user)
visit debate_path(debate)
- fill_in "comment_body", with: "I am your Admin!"
- check "comment_as_administrator"
+ fill_in "comment-body-debate_#{debate.id}", with: "I am your Admin!"
+ check "comment-as-administrator-debate_#{debate.id}"
click_button "Publish comment"
within "#comments" do
@@ -262,8 +262,8 @@ feature 'Comments' do
click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do
- fill_in "comment_body", with: "Top of the world!"
- check "comment_as_administrator"
+ fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!"
+ check "comment-as-administrator-comment_#{comment.id}"
click_button 'Publish reply'
end
diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb
index 591e0cebd..5773293cd 100644
--- a/spec/support/common_actions.rb
+++ b/spec/support/common_actions.rb
@@ -30,7 +30,7 @@ module CommonActions
login_as(user2)
visit debate_path(debate)
- fill_in 'comment_body', with: 'Have you thought about...?'
+ fill_in "comment-body-debate_#{debate.id}", with: 'Have you thought about...?'
click_button 'Publish comment'
expect(page).to have_content 'Have you thought about...?'
end
@@ -45,7 +45,7 @@ module CommonActions
click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do
- fill_in 'comment_body', with: 'It will be done next week.'
+ fill_in "comment-body-comment_#{comment.id}", with: 'It will be done next week.'
click_button 'Publish reply'
end
expect(page).to have_content 'It will be done next week.'