From edd8883deba401b04528fccb9b6b4cb3ad052217 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 6 Jul 2016 13:43:05 +0200 Subject: [PATCH] Fixes specs --- .../document_verifications/invalid_document.html.erb | 3 +-- spec/features/admin/banners_spec.rb | 4 ++-- spec/features/comments/debates_spec.rb | 6 +++--- spec/features/comments/proposals_spec.rb | 6 +++--- spec/features/official_positions_spec.rb | 1 + spec/features/verification/letter_spec.rb | 2 +- spec/features/verification/residence_spec.rb | 12 ++++++------ spec/models/residence_spec.rb | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/views/management/document_verifications/invalid_document.html.erb b/app/views/management/document_verifications/invalid_document.html.erb index d2b2f22c1..4e867b8f6 100644 --- a/app/views/management/document_verifications/invalid_document.html.erb +++ b/app/views/management/document_verifications/invalid_document.html.erb @@ -12,6 +12,5 @@

<%= t("management.document_verifications.has_no_account_html", - link: link_to(t('management.document_verifications.link'), root_path)).html_safe, - target: "_blank") %> + link: link_to(t('management.document_verifications.link'), root_path, target: "_blank")).html_safe %>

diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index 6d7779aa4..8578778ed 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -85,7 +85,7 @@ feature 'Admin banners magement' do select 'Banner image 2', from: 'banner_image' fill_in 'banner_title', with: 'Such banner' fill_in 'banner_description', with: 'many text wow link' - fill_in 'banner_target_url', with: 'https://decide.madrid.es' + fill_in 'banner_target_url', with: 'https://www.url.com' last_week = Time.now - 7.days next_week = Time.now + 7.days fill_in 'post_started_at', with: last_week.strftime("%d/%m/%Y") @@ -98,7 +98,7 @@ feature 'Admin banners magement' do visit proposals_path expect(page).to have_content 'Such banner' - expect(page).to have_link 'Such banner many text wow link', href: 'https://decide.madrid.es' + expect(page).to have_link 'Such banner many text wow link', href: 'https://www.url.com' end scenario 'Edit banner with live refresh', :js do diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index d80b08bc0..d9e58343a 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -118,13 +118,13 @@ feature 'Commenting debates' do end scenario 'Sanitizes comment body for security' do - create :comment, commentable: debate, body: " click me http://madrid.es" + create :comment, commentable: debate, body: " click me http://www.url.com" visit debate_path(debate) within first('.comment') do - expect(page).to have_content "click me http://madrid.es" - expect(page).to have_link('http://madrid.es', href: 'http://madrid.es') + expect(page).to have_content "click me http://www.url.com" + expect(page).to have_link('http://www.url.com', href: 'http://www.url.com') expect(page).not_to have_link('click me') end end diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index 8312176cd..a861615b7 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -118,13 +118,13 @@ feature 'Commenting proposals' do end scenario 'Sanitizes comment body for security' do - create :comment, commentable: proposal, body: " click me http://madrid.es" + create :comment, commentable: proposal, body: " click me http://www.url.com" visit proposal_path(proposal) within first('.comment') do - expect(page).to have_content "click me http://madrid.es" - expect(page).to have_link('http://madrid.es', href: 'http://madrid.es') + expect(page).to have_content "click me http://www.url.com" + expect(page).to have_link('http://www.url.com', href: 'http://www.url.com') expect(page).not_to have_link('click me') end end diff --git a/spec/features/official_positions_spec.rb b/spec/features/official_positions_spec.rb index 01f78370a..ff31c0a27 100644 --- a/spec/features/official_positions_spec.rb +++ b/spec/features/official_positions_spec.rb @@ -55,6 +55,7 @@ feature 'Official positions' do scenario "Index" do visit proposals_path + debugger expect_badge_for("proposal", @proposal1) expect_no_badge_for("proposal", @proposal2) diff --git a/spec/features/verification/letter_spec.rb b/spec/features/verification/letter_spec.rb index 50635a73c..9a9b2500b 100644 --- a/spec/features/verification/letter_spec.rb +++ b/spec/features/verification/letter_spec.rb @@ -26,7 +26,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_link "Citizen Support Offices", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" + expect(page).to have_link "Citizen Support Offices", href: "http://offices.consul" end scenario "Deny access unless verified residence" do diff --git a/spec/features/verification/residence_spec.rb b/spec/features/verification/residence_spec.rb index 1961269da..88d1579a9 100644 --- a/spec/features/verification/residence_spec.rb +++ b/spec/features/verification/residence_spec.rb @@ -4,7 +4,7 @@ feature 'Residence' do background { create(:geozone) } - scenario 'Verify resident in Madrid' do + scenario 'Verify resident' do user = create(:user) login_as(user) @@ -34,7 +34,7 @@ feature 'Residence' do expect(page).to have_content /\d errors? prevented the verification of your residence/ end - scenario 'Error on postal code not in Madrid census' do + scenario 'Error on postal code not in census' do user = create(:user) login_as(user) @@ -51,10 +51,10 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'In order to be verified, you must be registered in the municipality of Madrid' + expect(page).to have_content 'In order to be verified, you must be registered' end - scenario 'Error on Madrid census' do + scenario 'Error on census' do user = create(:user) login_as(user) @@ -71,7 +71,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'The Madrid Census was unable to verify your information' + expect(page).to have_content 'The Census was unable to verify your information' end scenario '5 tries allowed' do @@ -91,7 +91,7 @@ feature 'Residence' do check 'residence_terms_of_service' click_button 'Verify residence' - expect(page).to have_content 'The Madrid Census was unable to verify your information' + expect(page).to have_content 'The Census was unable to verify your information' end click_button 'Verify residence' diff --git a/spec/models/residence_spec.rb b/spec/models/residence_spec.rb index ce151eaee..5288a20b5 100644 --- a/spec/models/residence_spec.rb +++ b/spec/models/residence_spec.rb @@ -49,7 +49,7 @@ describe Verification::Residence do residence.postal_code = "13280" residence.valid? expect(residence.errors[:postal_code].size).to eq(1) - expect(residence.errors[:postal_code]).to include("In order to be verified, you must be registered in the municipality of Madrid.") + expect(residence.errors[:postal_code]).to include("In order to be verified, you must be registered.") end end