Use label text instead of ID to fill in comments

This way tests are easier to read (and easier to write).
This commit is contained in:
Javi Martín
2020-05-11 00:51:20 +02:00
parent 5d362ced1f
commit 61a63ddd59
11 changed files with 65 additions and 61 deletions

View File

@@ -53,7 +53,7 @@ shared_examples "notifiable in-app" do |factory_name|
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I replied to your comment" fill_in comment_body(notifiable), with: "I replied to your comment"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -79,7 +79,7 @@ shared_examples "notifiable in-app" do |factory_name|
within("#comment_#{comment.id}_reply") { click_link "Reply" } within("#comment_#{comment.id}_reply") { click_link "Reply" }
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Reply number #{n}" fill_in comment_body(notifiable), with: "Reply number #{n}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -121,7 +121,7 @@ shared_examples "notifiable in-app" do |factory_name|
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I replied to my own comment" fill_in comment_body(notifiable), with: "I replied to my own comment"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -17,7 +17,7 @@ module Comments
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
expect(page).to have_content "It will be done next week." expect(page).to have_content "It will be done next week."

View File

@@ -10,7 +10,11 @@ module Notifications
end end
def comment_body(resource) def comment_body(resource)
"comment-body-#{resource.class.name.parameterize(separator: "_").to_sym}_#{resource.id}" if resource.class.name == "Legislation::Question"
"Leave your answer"
else
"Leave your comment"
end
end end
def submit_comment_text(resource) def submit_comment_text(resource)

View File

@@ -199,7 +199,7 @@ describe "Commenting Budget::Investments" do
login_as(user) login_as(user)
visit budget_investment_path(investment.budget, investment) visit budget_investment_path(investment.budget, investment)
fill_in "comment-body-budget_investment_#{investment.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#tab-comments-label" do within "#tab-comments-label" do
@@ -231,7 +231,7 @@ describe "Commenting Budget::Investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -334,7 +334,7 @@ describe "Commenting Budget::Investments" do
login_as(moderator.user) login_as(moderator.user)
visit budget_investment_path(investment.budget, investment) visit budget_investment_path(investment.budget, investment)
fill_in "comment-body-budget_investment_#{investment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-budget_investment_#{investment.id}" check "comment-as-moderator-budget_investment_#{investment.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -358,7 +358,7 @@ describe "Commenting Budget::Investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -391,7 +391,7 @@ describe "Commenting Budget::Investments" do
login_as(admin.user) login_as(admin.user)
visit budget_investment_path(investment.budget, investment) visit budget_investment_path(investment.budget, investment)
fill_in "comment-body-budget_investment_#{investment.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-budget_investment_#{investment.id}" check "comment-as-administrator-budget_investment_#{investment.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -410,7 +410,7 @@ describe "Commenting Budget::Investments" do
visit admin_budget_budget_investment_path(investment.budget, investment) visit admin_budget_budget_investment_path(investment.budget, investment)
fill_in "comment-body-budget_investment_#{investment.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-budget_investment_#{investment.id}" check "comment-as-administrator-budget_investment_#{investment.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -434,7 +434,7 @@ describe "Commenting Budget::Investments" do
login_as(admin.user) login_as(admin.user)
visit admin_budget_budget_investment_path(investment.budget, investment) visit admin_budget_budget_investment_path(investment.budget, investment)
fill_in "comment-body-budget_investment_#{investment.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-budget_investment_#{investment.id}" check "comment-as-administrator-budget_investment_#{investment.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -458,7 +458,7 @@ describe "Commenting Budget::Investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -216,7 +216,7 @@ describe "Commenting debates" do
login_as(user) login_as(user)
visit debate_path(debate) visit debate_path(debate)
fill_in "comment-body-debate_#{debate.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -245,7 +245,7 @@ describe "Commenting debates" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -371,7 +371,7 @@ describe "Commenting debates" do
login_as(user) login_as(user)
visit debate_path(debate) visit debate_path(debate)
fill_in "comment-body-debate_#{debate.id}", with: "Testing submit button!" fill_in "Leave your comment", with: "Testing submit button!"
click_button "Publish comment" click_button "Publish comment"
# The button"s text should now be "..." # The button"s text should now be "..."
@@ -388,7 +388,7 @@ describe "Commenting debates" do
login_as(moderator.user) login_as(moderator.user)
visit debate_path(debate) visit debate_path(debate)
fill_in "comment-body-debate_#{debate.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-debate_#{debate.id}" check "comment-as-moderator-debate_#{debate.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -412,7 +412,7 @@ describe "Commenting debates" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -444,7 +444,7 @@ describe "Commenting debates" do
login_as(admin.user) login_as(admin.user)
visit debate_path(debate) visit debate_path(debate)
fill_in "comment-body-debate_#{debate.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-debate_#{debate.id}" check "comment-as-administrator-debate_#{debate.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -468,7 +468,7 @@ describe "Commenting debates" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -233,7 +233,7 @@ describe "Commenting legislation questions" do
legislation_annotation.draft_version, legislation_annotation.draft_version,
legislation_annotation) legislation_annotation)
fill_in "comment-body-legislation_annotation_#{legislation_annotation.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -267,7 +267,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -384,7 +384,7 @@ describe "Commenting legislation questions" do
legislation_annotation.draft_version, legislation_annotation.draft_version,
legislation_annotation) legislation_annotation)
fill_in "comment-body-legislation_annotation_#{legislation_annotation.id}", with: "Testing submit button!" fill_in "Leave your comment", with: "Testing submit button!"
click_button "Publish comment" click_button "Publish comment"
# The button's text should now be "..." # The button's text should now be "..."
@@ -403,7 +403,7 @@ describe "Commenting legislation questions" do
legislation_annotation.draft_version, legislation_annotation.draft_version,
legislation_annotation) legislation_annotation)
fill_in "comment-body-legislation_annotation_#{legislation_annotation.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-legislation_annotation_#{legislation_annotation.id}" check "comment-as-moderator-legislation_annotation_#{legislation_annotation.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -430,7 +430,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -466,7 +466,7 @@ describe "Commenting legislation questions" do
legislation_annotation.draft_version, legislation_annotation.draft_version,
legislation_annotation) legislation_annotation)
fill_in "comment-body-legislation_annotation_#{legislation_annotation.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-legislation_annotation_#{legislation_annotation.id}" check "comment-as-administrator-legislation_annotation_#{legislation_annotation.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -493,7 +493,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -667,7 +667,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "replying in single annotation thread" fill_in "Leave your comment", with: "replying in single annotation thread"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -706,7 +706,7 @@ describe "Commenting legislation questions" do
end end
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "replying in multiple annotation thread" fill_in "Leave your comment", with: "replying in multiple annotation thread"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -202,7 +202,7 @@ describe "Commenting legislation questions" do
login_as(user) login_as(user)
visit legislation_process_question_path(legislation_question.process, legislation_question) visit legislation_process_question_path(legislation_question.process, legislation_question)
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "Have you thought about...?" fill_in "Leave your answer", with: "Have you thought about...?"
click_button "Publish answer" click_button "Publish answer"
within "#comments" do within "#comments" do
@@ -249,7 +249,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your answer", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -348,7 +348,7 @@ describe "Commenting legislation questions" do
login_as(user) login_as(user)
visit legislation_process_question_path(legislation_question.process, legislation_question) visit legislation_process_question_path(legislation_question.process, legislation_question)
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "Testing submit button!" fill_in "Leave your answer", with: "Testing submit button!"
click_button "Publish answer" click_button "Publish answer"
# The button's text should now be "..." # The button's text should now be "..."
@@ -365,7 +365,7 @@ describe "Commenting legislation questions" do
login_as(moderator.user) login_as(moderator.user)
visit legislation_process_question_path(legislation_question.process, legislation_question) visit legislation_process_question_path(legislation_question.process, legislation_question)
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "I am moderating!" fill_in "Leave your answer", with: "I am moderating!"
check "comment-as-moderator-legislation_question_#{legislation_question.id}" check "comment-as-moderator-legislation_question_#{legislation_question.id}"
click_button "Publish answer" click_button "Publish answer"
@@ -389,7 +389,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your answer", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -421,7 +421,7 @@ describe "Commenting legislation questions" do
login_as(admin.user) login_as(admin.user)
visit legislation_process_question_path(legislation_question.process, legislation_question) visit legislation_process_question_path(legislation_question.process, legislation_question)
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "I am your Admin!" fill_in "Leave your answer", with: "I am your Admin!"
check "comment-as-administrator-legislation_question_#{legislation_question.id}" check "comment-as-administrator-legislation_question_#{legislation_question.id}"
click_button "Publish answer" click_button "Publish answer"
@@ -445,7 +445,7 @@ describe "Commenting legislation questions" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your answer", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -197,7 +197,7 @@ describe "Commenting polls" do
login_as(user) login_as(user)
visit poll_path(poll) visit poll_path(poll)
fill_in "comment-body-poll_#{poll.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -229,7 +229,7 @@ describe "Commenting polls" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -340,7 +340,7 @@ describe "Commenting polls" do
login_as(moderator.user) login_as(moderator.user)
visit poll_path(poll) visit poll_path(poll)
fill_in "comment-body-poll_#{poll.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-poll_#{poll.id}" check "comment-as-moderator-poll_#{poll.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -366,7 +366,7 @@ describe "Commenting polls" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -402,7 +402,7 @@ describe "Commenting polls" do
login_as(admin.user) login_as(admin.user)
visit poll_path(poll) visit poll_path(poll)
fill_in "comment-body-poll_#{poll.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-poll_#{poll.id}" check "comment-as-administrator-poll_#{poll.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -428,7 +428,7 @@ describe "Commenting polls" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -195,7 +195,7 @@ describe "Commenting proposals" do
login_as(user) login_as(user)
visit proposal_path(proposal) visit proposal_path(proposal)
fill_in "comment-body-proposal_#{proposal.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -227,7 +227,7 @@ describe "Commenting proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -330,7 +330,7 @@ describe "Commenting proposals" do
login_as(moderator.user) login_as(moderator.user)
visit proposal_path(proposal) visit proposal_path(proposal)
fill_in "comment-body-proposal_#{proposal.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-proposal_#{proposal.id}" check "comment-as-moderator-proposal_#{proposal.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -354,7 +354,7 @@ describe "Commenting proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -386,7 +386,7 @@ describe "Commenting proposals" do
login_as(admin.user) login_as(admin.user)
visit proposal_path(proposal) visit proposal_path(proposal)
fill_in "comment-body-proposal_#{proposal.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-proposal_#{proposal.id}" check "comment-as-administrator-proposal_#{proposal.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -410,7 +410,7 @@ describe "Commenting proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -216,7 +216,7 @@ describe "Commenting topics from proposals" do
login_as(user) login_as(user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -253,7 +253,7 @@ describe "Commenting topics from proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -369,7 +369,7 @@ describe "Commenting topics from proposals" do
login_as(moderator.user) login_as(moderator.user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-topic_#{topic.id}" check "comment-as-moderator-topic_#{topic.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -395,7 +395,7 @@ describe "Commenting topics from proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -431,7 +431,7 @@ describe "Commenting topics from proposals" do
login_as(admin.user) login_as(admin.user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-topic_#{topic.id}" check "comment-as-administrator-topic_#{topic.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -457,7 +457,7 @@ describe "Commenting topics from proposals" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -776,7 +776,7 @@ describe "Commenting topics from budget investments" do
login_as(user) login_as(user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "Have you thought about...?" fill_in "Leave your comment", with: "Have you thought about...?"
click_button "Publish comment" click_button "Publish comment"
within "#comments" do within "#comments" do
@@ -813,7 +813,7 @@ describe "Commenting topics from budget investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end
@@ -929,7 +929,7 @@ describe "Commenting topics from budget investments" do
login_as(moderator.user) login_as(moderator.user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-topic_#{topic.id}" check "comment-as-moderator-topic_#{topic.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -955,7 +955,7 @@ describe "Commenting topics from budget investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "I am moderating!" fill_in "Leave your comment", with: "I am moderating!"
check "comment-as-moderator-comment_#{comment.id}" check "comment-as-moderator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end
@@ -991,7 +991,7 @@ describe "Commenting topics from budget investments" do
login_as(admin.user) login_as(admin.user)
visit community_topic_path(community, topic) visit community_topic_path(community, topic)
fill_in "comment-body-topic_#{topic.id}", with: "I am your Admin!" fill_in "Leave your comment", with: "I am your Admin!"
check "comment-as-administrator-topic_#{topic.id}" check "comment-as-administrator-topic_#{topic.id}"
click_button "Publish comment" click_button "Publish comment"
@@ -1017,7 +1017,7 @@ describe "Commenting topics from budget investments" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "Top of the world!" fill_in "Leave your comment", with: "Top of the world!"
check "comment-as-administrator-comment_#{comment.id}" check "comment-as-administrator-comment_#{comment.id}"
click_button "Publish reply" click_button "Publish reply"
end end

View File

@@ -443,7 +443,7 @@ describe "Emails" do
click_link "Reply" click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do within "#js-comment-form-comment_#{comment.id}" do
fill_in "comment-body-comment_#{comment.id}", with: "It will be done next week." fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply" click_button "Publish reply"
end end