aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/request/new_bad_contact.rhtml4
-rw-r--r--spec/controllers/request_controller_spec.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/app/views/request/new_bad_contact.rhtml b/app/views/request/new_bad_contact.rhtml
index 41a2cef4d..56f3f4168 100644
--- a/app/views/request/new_bad_contact.rhtml
+++ b/app/views/request/new_bad_contact.rhtml
@@ -3,8 +3,8 @@
<h1><%=@title%></h1>
<p><%= _('Unfortunately, we do not have a working {{info_request_law_used_full}}
-address for'),:info_request_law_used_full => @info_request.law_used_full %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find
+address for', :info_request_law_used_full => @info_request.law_used_full) %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find
one on their website, or by phoning them up and asking. If you manage
-to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path] %>
+to find one, then please <a href="{{help_url}}">send it to us</a>.', :help_url => help_contact_path) %>
</p>
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index dcd33d279..a9315ddb2 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -308,6 +308,13 @@ describe RequestController, "when creating a new request" do
response.should redirect_to(:controller => 'general', :action => 'frontpage')
end
+ it "should redirect 'bad request' page when a body has no email address" do
+ @body.request_email = ""
+ @body.save!
+ get :new, :public_body_id => @body.id
+ response.should render_template('new_bad_contact')
+ end
+
it "should accept a public body parameter" do
get :new, :public_body_id => @body.id
assigns[:info_request].public_body.should == @body