Remove commented votation tests

They don't pass, and they aren't maintained anymore.
This commit is contained in:
Javi Martín
2019-07-01 01:14:45 +02:00
parent 233e65f18c
commit 9e522e713b

View File

@@ -295,101 +295,6 @@ describe "Poll Votation Type" do
end
end
xcontext "Positive and negative open" do
let(:user) { create(:user, :verified) }
let(:poll_current) { create(:poll, :current) }
let(:question) { create(:poll_question_positive_negative_open, poll: poll_current) }
let!(:answer1) { create(:poll_question_answer, question: question, title: "answer_1") }
let!(:answer2) { create(:poll_question_answer, question: question, title: "answer_2") }
let!(:answer3) { create(:poll_question_answer, question: question, title: "answer_3") }
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
before do
login_as(user)
end
scenario "response question" do
visit poll_path(poll_current)
question.question_answers.each do |answer|
within("#poll_question_#{question.id}_answers") do
expect(page).to have_content(answer.title)
end
end
end
scenario "response question vote", :js do
visit poll_path(poll_current)
question.question_answers.each do |answer|
title = "vote #{answer.title}"
page.find("poll_question_#{question.id}_answers .in-favor a[title=#{title}]").click
page.find("poll_question_#{question.id}_answers .in-favor a[title=#{title}]").has_css?(".answered")
end
end
scenario "response question no more vote than allowed", :js do
visit poll_path(poll_current)
question.question_answers.each do |answer|
within("#poll_question_#{question.id}_answers") do
click_link answer.title
end
end
answer6 = create(:poll_question_answer, question: question, title: "answer_6")
visit poll_path(poll_current)
within("#poll_question_#{question.id}_answers") do
click_link answer6.title
expect(page.find_link(answer6.title)).not_to have_css(".answered")
end
end
scenario "response question remove vote and vote again", :js do
visit poll_path(poll_current)
question.question_answers.each do |answer|
within("#poll_question_#{question.id}_answers") do
click_link answer.title
end
end
visit poll_path(poll_current)
within("#poll_question_#{question.id}_answers") do
click_link answer1.title
end
answer6 = create(:poll_question_answer, question: question, title: "answer_6")
visit poll_path(poll_current)
within("#poll_question_#{question.id}_answers") do
click_link answer6.title
page.find_link(answer6.title).has_css?(".answered")
end
end
scenario "add answer", :js do
visit poll_path(poll_current)
fill_in "answer", with: "added_answer"
click_button "Add answer"
visit poll_path(poll_current)
within("#poll_question_#{question.id}_answers") do
expect(page).to have_css("a", text: "added_answer")
click_link "added_answer"
expect(page).to have_css(".answered", text: "added_answer")
end
end
end
context "Answers set" do
let(:user) { create(:user, :verified) }