Unify voting comments update specs

This commit is contained in:
taitus
2023-12-19 23:41:22 +01:00
parent 35bc03f640
commit 992a8182ff
8 changed files with 24 additions and 192 deletions

View File

@@ -81,30 +81,6 @@ describe "Commenting Budget::Investments" do
login_as(verified)
end
scenario "Update" do
visit budget_investment_path(budget, investment)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit budget_investment_path(budget, investment)

View File

@@ -135,30 +135,6 @@ describe "Commenting debates" do
login_as(verified)
end
scenario "Update" do
visit debate_path(debate)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit debate_path(debate)

View File

@@ -30,30 +30,6 @@ describe "Commenting legislation questions" do
login_as(verified)
end
scenario "Update" do
visit polymorphic_path(annotation)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit polymorphic_path(annotation)

View File

@@ -32,30 +32,6 @@ describe "Commenting legislation questions" do
login_as(verified)
end
scenario "Update" do
visit legislation_process_question_path(question.process, question)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit legislation_process_question_path(question.process, question)

View File

@@ -14,30 +14,6 @@ describe "Commenting polls" do
login_as(verified)
end
scenario "Update" do
visit poll_path(poll)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit poll_path(poll)

View File

@@ -15,30 +15,6 @@ describe "Commenting proposals" do
login_as(verified)
end
scenario "Update" do
visit proposal_path(proposal)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit proposal_path(proposal)

View File

@@ -16,30 +16,6 @@ describe "Commenting topics from proposals" do
login_as(verified)
end
scenario "Update" do
visit community_topic_path(proposal.community, topic)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit community_topic_path(proposal.community, topic)
@@ -81,30 +57,6 @@ describe "Commenting topics from budget investments" do
login_as(verified)
end
scenario "Update" do
visit community_topic_path(investment.community, topic)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
scenario "Allow undoing votes" do
visit community_topic_path(investment.community, topic)

View File

@@ -541,6 +541,30 @@ describe "Comments" do
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit polymorphic_path(resource)
within("#comment_#{comment.id}_votes") do
click_button "I agree"
within(".in-favor") do
expect(page).to have_content "1"
end
click_button "I disagree"
within(".in-favor") do
expect(page).to have_content "0"
end
within(".against") do
expect(page).to have_content "1"
end
expect(page).to have_content "1 vote"
end
end
end
scenario "Errors on create" do