Fixes specs

This commit is contained in:
Alberto Garcia Cabeza
2016-07-06 14:47:09 +02:00
parent 219f4e2c15
commit 702cfe13d1
7 changed files with 17 additions and 18 deletions

View File

@@ -12,6 +12,5 @@
<p> <p>
<%= t("management.document_verifications.has_no_account_html", <%= t("management.document_verifications.has_no_account_html",
link: link_to(t('management.document_verifications.link'), root_path)).html_safe, link: link_to(t('management.document_verifications.link'), root_path, target: "_blank")).html_safe %>
target: "_blank") %>
</p> </p>

View File

@@ -85,7 +85,7 @@ feature 'Admin banners magement' do
select 'Banner image 2', from: 'banner_image' select 'Banner image 2', from: 'banner_image'
fill_in 'banner_title', with: 'Such banner' fill_in 'banner_title', with: 'Such banner'
fill_in 'banner_description', with: 'many text wow link' 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 last_week = Time.now - 7.days
next_week = Time.now + 7.days next_week = Time.now + 7.days
fill_in 'post_started_at', with: last_week.strftime("%d/%m/%Y") fill_in 'post_started_at', with: last_week.strftime("%d/%m/%Y")
@@ -98,7 +98,7 @@ feature 'Admin banners magement' do
visit proposals_path visit proposals_path
expect(page).to have_content 'Such banner' 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 end
scenario 'Edit banner with live refresh', :js do scenario 'Edit banner with live refresh', :js do

View File

@@ -118,13 +118,13 @@ feature 'Commenting debates' do
end end
scenario 'Sanitizes comment body for security' do scenario 'Sanitizes comment body for security' do
create :comment, commentable: debate, body: "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">click me<a/> http://madrid.es" create :comment, commentable: debate, body: "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">click me<a/> http://www.url.com"
visit debate_path(debate) visit debate_path(debate)
within first('.comment') do within first('.comment') do
expect(page).to have_content "click me http://madrid.es" expect(page).to have_content "click me http://www.url.com"
expect(page).to have_link('http://madrid.es', href: 'http://madrid.es') expect(page).to have_link('http://www.url.com', href: 'http://www.url.com')
expect(page).not_to have_link('click me') expect(page).not_to have_link('click me')
end end
end end

View File

@@ -118,13 +118,13 @@ feature 'Commenting proposals' do
end end
scenario 'Sanitizes comment body for security' do scenario 'Sanitizes comment body for security' do
create :comment, commentable: proposal, body: "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">click me<a/> http://madrid.es" create :comment, commentable: proposal, body: "<script>alert('hola')</script> <a href=\"javascript:alert('sorpresa!')\">click me<a/> http://www.url.com"
visit proposal_path(proposal) visit proposal_path(proposal)
within first('.comment') do within first('.comment') do
expect(page).to have_content "click me http://madrid.es" expect(page).to have_content "click me http://www.url.com"
expect(page).to have_link('http://madrid.es', href: 'http://madrid.es') expect(page).to have_link('http://www.url.com', href: 'http://www.url.com')
expect(page).not_to have_link('click me') expect(page).not_to have_link('click me')
end end
end end

View File

@@ -26,7 +26,7 @@ feature 'Verify Letter' do
login_as(user) login_as(user)
visit new_letter_path 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 end
scenario "Deny access unless verified residence" do scenario "Deny access unless verified residence" do

View File

@@ -4,7 +4,7 @@ feature 'Residence' do
background { create(:geozone) } background { create(:geozone) }
scenario 'Verify resident in Madrid' do scenario 'Verify resident' do
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -34,7 +34,7 @@ feature 'Residence' do
expect(page).to have_content /\d errors? prevented the verification of your residence/ expect(page).to have_content /\d errors? prevented the verification of your residence/
end end
scenario 'Error on postal code not in Madrid census' do scenario 'Error on postal code not in census' do
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -51,10 +51,10 @@ feature 'Residence' do
click_button 'Verify residence' 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 end
scenario 'Error on Madrid census' do scenario 'Error on census' do
user = create(:user) user = create(:user)
login_as(user) login_as(user)
@@ -71,7 +71,7 @@ feature 'Residence' do
click_button 'Verify residence' 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 end
scenario '5 tries allowed' do scenario '5 tries allowed' do
@@ -91,7 +91,7 @@ feature 'Residence' do
check 'residence_terms_of_service' check 'residence_terms_of_service'
click_button 'Verify residence' 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 end
click_button 'Verify residence' click_button 'Verify residence'

View File

@@ -49,7 +49,7 @@ describe Verification::Residence do
residence.postal_code = "13280" residence.postal_code = "13280"
residence.valid? residence.valid?
expect(residence.errors[:postal_code].size).to eq(1) 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
end end