fix js bug, add spec
This commit is contained in:
parent
cd92b1dccb
commit
a5b4dd2604
2 changed files with 12 additions and 2 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
%br
|
%br
|
||||||
|
|
||||||
- if current_user.services
|
- if current_user.services
|
||||||
- for service in current_user.services
|
- for service in current_user.services
|
||||||
= t('.logged_in', :service => service.provider)
|
= t('.logged_in', :service => service.provider)
|
||||||
%br
|
%br
|
||||||
|
|
||||||
|
|
@ -19,4 +19,4 @@
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
= link_to t('ok'), '#', :class => "button", :onClick => '$.fancybox.close();'
|
= link_to t('ok'), '#', :class => "button", :onClick => '$.facebox.close();'
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,16 @@ describe PeopleController do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not allow xss attacks' do
|
||||||
|
user2 = bob
|
||||||
|
profile = user2.profile
|
||||||
|
profile.first_name = "<script> alert('xss attack');</script>"
|
||||||
|
profile.save
|
||||||
|
get :show, :id => user2.person.id
|
||||||
|
response.should be_success
|
||||||
|
response.body.match(profile.first_name).should be_false
|
||||||
|
end
|
||||||
|
|
||||||
it "renders the show page of a non-contact" do
|
it "renders the show page of a non-contact" do
|
||||||
user2 = eve
|
user2 = eve
|
||||||
get :show, :id => user2.person.id
|
get :show, :id => user2.person.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue