diff options
-rw-r--r-- | app/helpers/application_helper.rb | 6 | ||||
-rw-r--r-- | spec/controllers/admin_request_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/track_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/fixtures/info_requests.yml | 2 | ||||
-rw-r--r-- | todo.txt | 3 |
5 files changed, 10 insertions, 5 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c2a279c4a..188775cc7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application_helper.rb,v 1.20 2008-04-24 23:52:59 francis Exp $ +# $Id: application_helper.rb,v 1.21 2008-05-27 01:57:02 francis Exp $ module ApplicationHelper # URL generating functions are needed by all controllers (for redirects), @@ -45,7 +45,9 @@ module ApplicationHelper # Highlight words, also escapes HTML (other than spans that we add) def highlight_words(t, words, html = true) - t = h(t) + if html + t = h(t) + end if html t = highlight(t, words, '<span class="highlight">\1</span>') else diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index 9fb621b25..ff0f74aed 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -17,7 +17,7 @@ describe AdminRequestController, "when administering requests" do end it "saves edits to a request" do - info_requests(:fancy_dog_request).title.should == "Why do you have such a fancy dog?" + info_requests(:fancy_dog_request).title.should == "Why do you have & such a fancy dog?" post :update, { :id => info_requests(:fancy_dog_request), :info_request => { :title => "Renamed", :prominence => "normal", :described_state => "waiting_response", :awaiting_description => false } } response.flash[:notice].should include('successful') ir = InfoRequest.find(info_requests(:fancy_dog_request).id) diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index 39542cb63..62f3a0140 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -50,6 +50,8 @@ describe TrackController, "when sending alerts for a track" do mail.body =~ /(http:\/\/.*\/c\/(.*))/ mail_url = $1 mail_token = $2 + + mail.body.should_not =~ /&/ # Check subscription managing link # XXX reenable this if we ever have a page manager in the track controller diff --git a/spec/fixtures/info_requests.yml b/spec/fixtures/info_requests.yml index a849542b8..bdeef4800 100644 --- a/spec/fixtures/info_requests.yml +++ b/spec/fixtures/info_requests.yml @@ -1,6 +1,6 @@ fancy_dog_request: id: 101 - title: Why do you have such a fancy dog? + title: Why do you have & such a fancy dog? url_title: why_do_you_have_such_a_fancy_dog created_at: 2007-10-11 18:15:57 updated_at: 2007-10-11 18:15:57 @@ -206,10 +206,11 @@ Quoting fixing TODO: http://www.whatdotheyknow.com/request/299/response/484 http://www.whatdotheyknow.com/request/320/response/605 (encoding, vcf) http://www.whatdotheyknow.com/request/118/response/600 (encoding) + http://www.whatdotheyknow.com/request/180/response/482 (charset) + http://www.whatdotheyknow.com/request/305/response/767 (charset) http://www.whatdotheyknow.com/request/235/response/513 http://www.whatdotheyknow.com/request/40/response/163 - Disclaimer http://www.whatdotheyknow.com/request/265/response/688 - word wrapping - http://www.whatdotheyknow.com/request/180/response/482 (charset) http://www.whatdotheyknow.com/request/576/response/812 http://www.whatdotheyknow.com/request/35/response/191 |