Unify voting comments create specs

This commit is contained in:
taitus
2023-12-19 23:38:24 +01:00
parent dbd419e75d
commit 35bc03f640
8 changed files with 18 additions and 144 deletions

View File

@@ -81,24 +81,6 @@ describe "Commenting Budget::Investments" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit budget_investment_path(budget, investment)

View File

@@ -135,24 +135,6 @@ describe "Commenting debates" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit debate_path(debate)

View File

@@ -30,24 +30,6 @@ describe "Commenting legislation questions" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit polymorphic_path(annotation)

View File

@@ -32,24 +32,6 @@ describe "Commenting legislation questions" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit legislation_process_question_path(question.process, question)

View File

@@ -14,24 +14,6 @@ describe "Commenting polls" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit poll_path(poll)

View File

@@ -15,24 +15,6 @@ describe "Commenting proposals" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit proposal_path(proposal)

View File

@@ -16,24 +16,6 @@ describe "Commenting topics from proposals" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit community_topic_path(proposal.community, topic)
@@ -99,24 +81,6 @@ describe "Commenting topics from budget investments" do
login_as(verified)
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
scenario "Update" do
visit community_topic_path(investment.community, topic)

View File

@@ -523,6 +523,24 @@ describe "Comments" do
expect(page).to have_content "2 votes"
end
end
scenario "Create" 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
within(".against") do
expect(page).to have_content "0"
end
expect(page).to have_content "1 vote"
end
end
end
scenario "Errors on create" do