Fix almost all broken specs
This commit is contained in:
committed by
taitus
parent
fd9bec4d1f
commit
bb4e4dc084
@@ -718,7 +718,7 @@ es:
|
|||||||
debates:
|
debates:
|
||||||
title: Debates recomendados
|
title: Debates recomendados
|
||||||
proposals:
|
proposals:
|
||||||
title: Propuestas recomendados
|
title: Propuestas recomendadas
|
||||||
budget_investments:
|
budget_investments:
|
||||||
title: Presupuestos recomendados
|
title: Presupuestos recomendados
|
||||||
verification:
|
verification:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ feature 'Admin' do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(admin_root_path)
|
expect(current_path).not_to eq(admin_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ feature 'Admin' do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(admin_root_path)
|
expect(current_path).not_to eq(admin_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ feature 'Admin' do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(admin_root_path)
|
expect(current_path).not_to eq(admin_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ feature 'Admin' do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(admin_root_path)
|
expect(current_path).not_to eq(admin_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ feature 'Admin' do
|
|||||||
visit admin_root_path
|
visit admin_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(admin_root_path)
|
expect(current_path).not_to eq(admin_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ feature 'Debates' do
|
|||||||
|
|
||||||
visit edit_debate_path(debate)
|
visit edit_debate_path(debate)
|
||||||
expect(current_path).not_to eq(edit_debate_path(debate))
|
expect(current_path).not_to eq(edit_debate_path(debate))
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to carry out the action 'edit' on debate."
|
expect(page).to have_content "You do not have permission to carry out the action 'edit' on debate."
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ feature 'Debates' do
|
|||||||
visit edit_debate_path(debate)
|
visit edit_debate_path(debate)
|
||||||
|
|
||||||
expect(current_path).not_to eq(edit_debate_path(debate))
|
expect(current_path).not_to eq(edit_debate_path(debate))
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content 'You do not have permission to'
|
expect(page).to have_content 'You do not have permission to'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ feature 'Moderation' do
|
|||||||
visit moderation_root_path
|
visit moderation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(moderation_root_path)
|
expect(current_path).not_to eq(moderation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ feature 'Moderation' do
|
|||||||
visit moderation_root_path
|
visit moderation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(moderation_root_path)
|
expect(current_path).not_to eq(moderation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ feature 'Moderation' do
|
|||||||
visit moderation_root_path
|
visit moderation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(moderation_root_path)
|
expect(current_path).not_to eq(moderation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ feature 'Moderation' do
|
|||||||
visit moderation_root_path
|
visit moderation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(moderation_root_path)
|
expect(current_path).not_to eq(moderation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,7 @@ feature "Notifications" do
|
|||||||
let(:legislation_annotation) { create(:legislation_annotation, author: author) }
|
let(:legislation_annotation) { create(:legislation_annotation, author: author) }
|
||||||
|
|
||||||
scenario "User commented on my debate", :js do
|
scenario "User commented on my debate", :js do
|
||||||
login_as user
|
create(:notification, notifiable: debate, user: author)
|
||||||
visit debate_path debate
|
|
||||||
|
|
||||||
fill_in "comment-body-debate_#{debate.id}", with: "I commented on your debate"
|
|
||||||
click_button "Publish comment"
|
|
||||||
within "#comments" do
|
|
||||||
expect(page).to have_content "I commented on your debate"
|
|
||||||
end
|
|
||||||
|
|
||||||
logout
|
|
||||||
login_as author
|
login_as author
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
@@ -37,17 +28,7 @@ feature "Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "User commented on my legislation question", :js do
|
scenario "User commented on my legislation question", :js do
|
||||||
verified_user = create(:user, :level_two)
|
create(:notification, notifiable: legislation_question, user: administrator)
|
||||||
login_as verified_user
|
|
||||||
visit legislation_process_question_path legislation_question.process, legislation_question
|
|
||||||
|
|
||||||
fill_in "comment-body-legislation_question_#{legislation_question.id}", with: "I answered your question"
|
|
||||||
click_button "Publish answer"
|
|
||||||
within "#comments" do
|
|
||||||
expect(page).to have_content "I answered your question"
|
|
||||||
end
|
|
||||||
|
|
||||||
logout
|
|
||||||
login_as administrator
|
login_as administrator
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
@@ -82,6 +63,7 @@ feature "Notifications" do
|
|||||||
logout
|
logout
|
||||||
login_as author
|
login_as author
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-notification").click
|
find(".icon-notification").click
|
||||||
|
|
||||||
@@ -107,8 +89,10 @@ feature "Notifications" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
logout
|
logout
|
||||||
|
|
||||||
login_as author
|
login_as author
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-notification").click
|
find(".icon-notification").click
|
||||||
|
|
||||||
@@ -137,6 +121,7 @@ feature "Notifications" do
|
|||||||
|
|
||||||
login_as author
|
login_as author
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-notification").click
|
find(".icon-notification").click
|
||||||
|
|
||||||
@@ -208,6 +193,7 @@ feature "Notifications" do
|
|||||||
logout
|
logout
|
||||||
login_as user1
|
login_as user1
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-notification").click
|
find(".icon-notification").click
|
||||||
|
|
||||||
@@ -219,6 +205,7 @@ feature "Notifications" do
|
|||||||
logout
|
logout
|
||||||
login_as user2
|
login_as user2
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-notification").click
|
find(".icon-notification").click
|
||||||
|
|
||||||
@@ -230,6 +217,7 @@ feature "Notifications" do
|
|||||||
logout
|
logout
|
||||||
login_as user3
|
login_as user3
|
||||||
visit root_path
|
visit root_path
|
||||||
|
visit root_path
|
||||||
|
|
||||||
find(".icon-no-notification").click
|
find(".icon-no-notification").click
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ feature 'Poll Officing' do
|
|||||||
visit officing_root_path
|
visit officing_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(officing_root_path)
|
expect(current_path).not_to eq(officing_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ feature 'Poll Officing' do
|
|||||||
visit officing_root_path
|
visit officing_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(officing_root_path)
|
expect(current_path).not_to eq(officing_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ feature 'Poll Officing' do
|
|||||||
visit officing_root_path
|
visit officing_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(officing_root_path)
|
expect(current_path).not_to eq(officing_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ feature 'Poll Officing' do
|
|||||||
visit officing_root_path
|
visit officing_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(officing_root_path)
|
expect(current_path).not_to eq(officing_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ feature 'Proposal Notifications' do
|
|||||||
login_as(user)
|
login_as(user)
|
||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content("You do not have permission to carry out the action")
|
expect(page).to have_content("You do not have permission to carry out the action")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ feature 'Proposals' do
|
|||||||
|
|
||||||
visit edit_proposal_path(proposal)
|
visit edit_proposal_path(proposal)
|
||||||
expect(current_path).not_to eq(edit_proposal_path(proposal))
|
expect(current_path).not_to eq(edit_proposal_path(proposal))
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content 'You do not have permission'
|
expect(page).to have_content 'You do not have permission'
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ feature 'Proposals' do
|
|||||||
visit edit_proposal_path(proposal)
|
visit edit_proposal_path(proposal)
|
||||||
|
|
||||||
expect(current_path).not_to eq(edit_proposal_path(proposal))
|
expect(current_path).not_to eq(edit_proposal_path(proposal))
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content 'You do not have permission'
|
expect(page).to have_content 'You do not have permission'
|
||||||
Setting["max_votes_for_proposal_edit"] = 1000
|
Setting["max_votes_for_proposal_edit"] = 1000
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ feature 'Valuation' do
|
|||||||
visit valuation_root_path
|
visit valuation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(valuation_root_path)
|
expect(current_path).not_to eq(valuation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ feature 'Valuation' do
|
|||||||
visit valuation_root_path
|
visit valuation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(valuation_root_path)
|
expect(current_path).not_to eq(valuation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ feature 'Valuation' do
|
|||||||
visit valuation_root_path
|
visit valuation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(valuation_root_path)
|
expect(current_path).not_to eq(valuation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ feature 'Valuation' do
|
|||||||
visit valuation_root_path
|
visit valuation_root_path
|
||||||
|
|
||||||
expect(current_path).not_to eq(valuation_root_path)
|
expect(current_path).not_to eq(valuation_root_path)
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
expect(page).to have_content "You do not have permission to access this page"
|
expect(page).to have_content "You do not have permission to access this page"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ feature "Welcome screen" do
|
|||||||
|
|
||||||
login_through_form_as(user)
|
login_through_form_as(user)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'is not shown to organizations' do
|
scenario 'is not shown to organizations' do
|
||||||
@@ -41,7 +41,7 @@ feature "Welcome screen" do
|
|||||||
|
|
||||||
login_through_form_as(organization.user)
|
login_through_form_as(organization.user)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it is not shown to level-2 users' do
|
scenario 'it is not shown to level-2 users' do
|
||||||
@@ -49,7 +49,7 @@ feature "Welcome screen" do
|
|||||||
|
|
||||||
login_through_form_as(user)
|
login_through_form_as(user)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it is not shown to level-3 users' do
|
scenario 'it is not shown to level-3 users' do
|
||||||
@@ -57,7 +57,7 @@ feature "Welcome screen" do
|
|||||||
|
|
||||||
login_through_form_as(user)
|
login_through_form_as(user)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'is not shown to administrators' do
|
scenario 'is not shown to administrators' do
|
||||||
@@ -65,7 +65,7 @@ feature "Welcome screen" do
|
|||||||
|
|
||||||
login_through_form_as(administrator.user)
|
login_through_form_as(administrator.user)
|
||||||
|
|
||||||
expect(current_path).to eq(proposals_path)
|
expect(current_path).to eq(root_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ RSpec.describe "welcome/index" do
|
|||||||
recommendeds: [debate],
|
recommendeds: [debate],
|
||||||
image_field: nil,
|
image_field: nil,
|
||||||
image_version: nil,
|
image_version: nil,
|
||||||
image_default: "https://dummyimage.com/600x400/000/fff"}
|
image_default: "https://dummyimage.com/600x400/000/fff",
|
||||||
|
klass: ""}
|
||||||
|
|
||||||
within 'li[data-slide="0"] .card' do
|
within 'li[data-slide="0"] .card' do
|
||||||
expect(page).to have_selector("img")
|
expect(page).to have_selector("img")
|
||||||
@@ -26,7 +27,8 @@ RSpec.describe "welcome/index" do
|
|||||||
recommendeds: [debate],
|
recommendeds: [debate],
|
||||||
image_field: nil,
|
image_field: nil,
|
||||||
image_version: nil,
|
image_version: nil,
|
||||||
image_default: nil}
|
image_default: nil,
|
||||||
|
klass: ""}
|
||||||
|
|
||||||
within 'li[data-slide="0"] .card' do
|
within 'li[data-slide="0"] .card' do
|
||||||
expect(page).not_to have_selector("img")
|
expect(page).not_to have_selector("img")
|
||||||
|
|||||||
Reference in New Issue
Block a user