diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-08-23 10:20:02 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-08-23 10:20:37 +0100 |
commit | 452472652df3cb7e64529e0511347e7d941b9e1c (patch) | |
tree | 3923d327834c6408bcf13dc51152702e3c6d2d2a | |
parent | 47e617e0fd4562aa19e7862f66600ad4098222c4 (diff) |
Handle the case where someone wants to add an annotation to a successful external request.
Fixes #563.
-rw-r--r-- | app/views/comment/new.rhtml | 4 | ||||
-rw-r--r-- | spec/controllers/comment_controller_spec.rb | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml index 55155c8a2..aa5b6051c 100644 --- a/app/views/comment/new.rhtml +++ b/app/views/comment/new.rhtml @@ -33,7 +33,7 @@ <% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %> <li><%= _(' <strong>Summarise</strong> the content of any information returned. ')%></li> <li><%= _(' Say how you\'ve <strong>used the information</strong>, with links if possible.')%> </li> - <li> <%= _('<strong>Thank</strong> the public authority or ')%><%=h @info_request.user.name %>. </li> + <li> <%= _('<strong>Thank</strong> the public authority or ')%><%=h (@info_request.user_name ? @info_request.user_name : _('the requester')) %>. </li> <% end %> <% if [ 'partially_successful' ].include?(@info_request.described_state) %> <li> <%= _('Suggest how the requester can find the <strong>rest of the information</strong>.')%></li> @@ -67,7 +67,7 @@ </ul> <p> - <big><%= _('Annotations will be posted publicly here, and are + <big><%= _('Annotations will be posted publicly here, and are <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></big> <% if @info_request.is_external? %> <big><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></big> diff --git a/spec/controllers/comment_controller_spec.rb b/spec/controllers/comment_controller_spec.rb index 93752537c..b71bc0aea 100644 --- a/spec/controllers/comment_controller_spec.rb +++ b/spec/controllers/comment_controller_spec.rb @@ -54,6 +54,26 @@ describe CommentController, "when commenting on a request" do response.should render_template('new') end + describe 'when commenting on an external request' do + + describe 'when responding to a GET request on a successful request' do + + before do + @external_request = info_requests(:external_request) + @external_request.described_state = 'successful' + @external_request.save! + end + + it 'should be successful' do + get :new, :url_title => @external_request.url_title, + :type => 'request' + response.should be_success + end + + end + + end + end |