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

@@ -118,13 +118,13 @@ feature 'Commenting proposals' do
end
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)
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