Fix almost all broken specs

This commit is contained in:
Senén Rodero Rodríguez
2017-07-22 18:29:04 +02:00
committed by taitus
parent fd9bec4d1f
commit bb4e4dc084
11 changed files with 41 additions and 51 deletions

View File

@@ -718,7 +718,7 @@ es:
debates:
title: Debates recomendados
proposals:
title: Propuestas recomendados
title: Propuestas recomendadas
budget_investments:
title: Presupuestos recomendados
verification:

View File

@@ -12,7 +12,7 @@ feature 'Admin' do
visit 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"
end
@@ -22,7 +22,7 @@ feature 'Admin' do
visit 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"
end
@@ -32,7 +32,7 @@ feature 'Admin' do
visit 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"
end
@@ -42,7 +42,7 @@ feature 'Admin' do
visit 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"
end
@@ -52,7 +52,7 @@ feature 'Admin' do
visit 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"
end

View File

@@ -219,7 +219,7 @@ feature 'Debates' do
visit 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."
end
@@ -234,7 +234,7 @@ feature 'Debates' do
visit 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'
end

View File

@@ -11,7 +11,7 @@ feature 'Moderation' do
visit 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"
end
@@ -25,7 +25,7 @@ feature 'Moderation' do
visit 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"
end
@@ -39,7 +39,7 @@ feature 'Moderation' do
visit 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"
end
@@ -53,7 +53,7 @@ feature 'Moderation' do
visit 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"
end

View File

@@ -15,16 +15,7 @@ feature "Notifications" do
let(:legislation_annotation) { create(:legislation_annotation, author: author) }
scenario "User commented on my debate", :js do
login_as user
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
create(:notification, notifiable: debate, user: author)
login_as author
visit root_path
@@ -37,17 +28,7 @@ feature "Notifications" do
end
scenario "User commented on my legislation question", :js do
verified_user = create(:user, :level_two)
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
create(:notification, notifiable: legislation_question, user: administrator)
login_as administrator
visit root_path
@@ -82,6 +63,7 @@ feature "Notifications" do
logout
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -107,8 +89,10 @@ feature "Notifications" do
end
logout
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -137,6 +121,7 @@ feature "Notifications" do
login_as author
visit root_path
visit root_path
find(".icon-notification").click
@@ -208,6 +193,7 @@ feature "Notifications" do
logout
login_as user1
visit root_path
visit root_path
find(".icon-notification").click
@@ -219,6 +205,7 @@ feature "Notifications" do
logout
login_as user2
visit root_path
visit root_path
find(".icon-notification").click
@@ -230,6 +217,7 @@ feature "Notifications" do
logout
login_as user3
visit root_path
visit root_path
find(".icon-no-notification").click

View File

@@ -11,7 +11,7 @@ feature 'Poll Officing' do
visit 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"
end
@@ -24,7 +24,7 @@ feature 'Poll Officing' do
visit 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"
end
@@ -37,7 +37,7 @@ feature 'Poll Officing' do
visit 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"
end
@@ -50,7 +50,7 @@ feature 'Poll Officing' do
visit 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"
end

View File

@@ -189,7 +189,7 @@ feature 'Proposal Notifications' do
login_as(user)
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")
end

View File

@@ -522,7 +522,7 @@ feature 'Proposals' do
visit 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'
end
@@ -537,7 +537,7 @@ feature 'Proposals' do
visit 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'
Setting["max_votes_for_proposal_edit"] = 1000
end

View File

@@ -21,7 +21,7 @@ feature 'Valuation' do
visit 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"
end
@@ -34,7 +34,7 @@ feature 'Valuation' do
visit 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"
end
@@ -47,7 +47,7 @@ feature 'Valuation' do
visit 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"
end
@@ -60,7 +60,7 @@ feature 'Valuation' do
visit 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"
end

View File

@@ -33,7 +33,7 @@ feature "Welcome screen" do
login_through_form_as(user)
expect(current_path).to eq(proposals_path)
expect(current_path).to eq(root_path)
end
scenario 'is not shown to organizations' do
@@ -41,7 +41,7 @@ feature "Welcome screen" do
login_through_form_as(organization.user)
expect(current_path).to eq(proposals_path)
expect(current_path).to eq(root_path)
end
scenario 'it is not shown to level-2 users' do
@@ -49,7 +49,7 @@ feature "Welcome screen" do
login_through_form_as(user)
expect(current_path).to eq(proposals_path)
expect(current_path).to eq(root_path)
end
scenario 'it is not shown to level-3 users' do
@@ -57,7 +57,7 @@ feature "Welcome screen" do
login_through_form_as(user)
expect(current_path).to eq(proposals_path)
expect(current_path).to eq(root_path)
end
scenario 'is not shown to administrators' do
@@ -65,7 +65,7 @@ feature "Welcome screen" do
login_through_form_as(administrator.user)
expect(current_path).to eq(proposals_path)
expect(current_path).to eq(root_path)
end
end

View File

@@ -10,7 +10,8 @@ RSpec.describe "welcome/index" do
recommendeds: [debate],
image_field: 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
expect(page).to have_selector("img")
@@ -26,7 +27,8 @@ RSpec.describe "welcome/index" do
recommendeds: [debate],
image_field: nil,
image_version: nil,
image_default: nil}
image_default: nil,
klass: ""}
within 'li[data-slide="0"] .card' do
expect(page).not_to have_selector("img")