diff --git a/app/views/comments/_edit.html.erb b/app/views/comments/_edit.html.erb
index 45a659f769..37e5624ccd 100644
--- a/app/views/comments/_edit.html.erb
+++ b/app/views/comments/_edit.html.erb
@@ -11,8 +11,8 @@
<%= render :partial => "editor/toolbar", :locals => { :comment_id => comment.id.to_s, :location => :edit } %>
-
-
diff --git a/app/views/questions/show.html.erb b/app/views/questions/show.html.erb
index fb0c49ef74..66fe31b531 100644
--- a/app/views/questions/show.html.erb
+++ b/app/views/questions/show.html.erb
@@ -2,6 +2,7 @@
<%= javascript_include_tag('notes') %>
<%= javascript_include_tag('textbox_expand') %>
<%= javascript_include_tag('question') %>
diff --git a/test/system/comment_test.rb b/test/system/comment_test.rb
index 8a78923253..56623e46dc 100644
--- a/test/system/comment_test.rb
+++ b/test/system/comment_test.rb
@@ -179,10 +179,10 @@ def get_path(page_type, path)
page.execute_script <<-JS
var comment = $(".comment")[1];
var commentID = comment.id;
- var editCommentBtn = $(comment).find('.navbar-text #edit-comment-btn')
+ var editCommentBtn = $(comment).find('.navbar-text .edit-comment-btn')
// Toggle edit mode
$(editCommentBtn).click()
- var commentTextarea = $('#' + commentID + 'text');
+ var commentTextarea = $('#text-input-edit-' + commentID);
$(commentTextarea).val('Updated comment.')
var submitCommentBtn = $('#' + commentID + ' .control-group .btn-primary')[1];
$(submitCommentBtn).click()
@@ -263,7 +263,7 @@ def get_path(page_type, path)
})
visit get_path(page_type, nodes(node_name).path)
# open the edit comment form:
- page.find("#edit-comment-btn").click
+ page.find(".edit-comment-btn").click
# find the parent of edit comment's fileinput:
comment_fileinput_parent_id = page.find('[id^=dropzone-small-edit-]')[:id] # 'begins with' CSS selector
comment_id_num = /dropzone-small-edit-(\d+)/.match(comment_fileinput_parent_id)[1]
@@ -336,13 +336,13 @@ def get_path(page_type, path)
})
visit get_path(page_type, nodes(node_name).path)
# open up the edit comment form
- page.find("#edit-comment-btn").click
+ page.find(".edit-comment-btn").click
edit_comment_form = page.find('h4', text: 'Edit comment').find(:xpath, '..')
# we need the comment ID:
edit_comment_form_id = edit_comment_form[:id]
# regex to strip the ID number out of string. ID format is #c1234edit
comment_id_num = /comment-form-edit-(\d+)/.match(edit_comment_form_id)[1]
- edit_preview_id = '#c' + comment_id_num + 'preview'
+ edit_preview_id = '#comment-preview-edit-' + comment_id_num
# the that take image uploads are hidden, so reveal them:
Capybara.ignore_hidden_elements = false
file_input_element = edit_comment_form.all('input')[1]
@@ -443,7 +443,7 @@ def get_path(page_type, path)
comment_id_num = /comment-body-(\d+)/.match(comment_id)[1]
comment_dropzone_selector = '#c' + comment_id_num + 'div'
# open the edit comment form
- page.find("#edit-comment-btn").click
+ page.find(".edit-comment-btn").click
# drop into the edit comment form
Capybara.ignore_hidden_elements = false
drop_in_dropzone("#{Rails.root.to_s}/public/images/pl.png", comment_dropzone_selector)
@@ -475,7 +475,7 @@ def get_path(page_type, path)
})
visit get_path(page_type, nodes(node_name).path)
# open the edit comment form:
- find("#edit-comment-btn").click
+ find(".edit-comment-btn").click
# find the parent of edit comment's fileinput:
comment_fileinput_parent_id = page.find('[id^=dropzone-small-edit-]')[:id] # 'begins with' CSS selector
comment_id_num = /dropzone-small-edit-(\d+)/.match(comment_fileinput_parent_id)[1]
@@ -496,7 +496,7 @@ def get_path(page_type, path)
page.find('#comment-form-edit-' + comment_id_num + ' a', text: 'Preview').click
# once preview is open, the images are embedded in the page.
# there should be 1 image in main, and 1 image in edit
- assert_selector('#c' + comment_id_num + 'preview img', count: 1)
+ assert_selector('#comment-preview-edit-' + comment_id_num + ' img', count: 1)
assert_selector('#comment-preview-main img', count: 1)
end
@@ -512,12 +512,12 @@ def get_path(page_type, path)
visit get_path(page_type, nodes(node_name).path)
# find the EDIT id
# open up the edit comment form
- page.find("#edit-comment-btn").click
+ page.find(".edit-comment-btn").click
edit_comment_form_id = page.find('h4', text: 'Edit comment').find(:xpath, '..')[:id]
# regex to strip the ID number out of string. ID format is #c1234edit
edit_id_num = /comment-form-edit-(\d+)/.match(edit_comment_form_id)[1]
# open the edit comment form
- edit_preview_id = '#c' + edit_id_num + 'preview'
+ edit_preview_id = '#comment-preview-edit-' + edit_id_num
# find the REPLY id
page.all('p', text: 'Reply to this comment...')[0].click
reply_dropzone_id = page.find('[id^=dropzone-small-reply-]')[:id]
@@ -536,7 +536,7 @@ def get_path(page_type, path)
# click preview buttons in reply and edit form
page.find('#comment-form-edit-' + edit_id_num + ' a', text: 'Preview').click
page.first('a', text: 'Preview').click
- assert_selector('#c' + edit_id_num + 'preview img', count: 1)
+ assert_selector('#comment-preview-edit-' + edit_id_num + ' img', count: 1)
assert_selector('#comment-preview-reply-' + reply_id_num, count: 1)
end
@@ -559,7 +559,7 @@ def get_path(page_type, path)
})
visit get_path(page_type, nodes(node_name).path)
# open up the edit comment form
- page.find("#edit-comment-btn").click
+ page.find(".edit-comment-btn").click
# find the EDIT id
edit_comment_form_id = page.find('h4', text: 'Edit comment').find(:xpath, '..')[:id]
# open up the reply comment form