diff options
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | Gemfile.lock | 4 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | app/mailers/request_mailer.rb | 3 | ||||
-rw-r--r-- | app/views/comment/_single_comment.html.erb | 4 | ||||
-rw-r--r-- | spec/mailers/request_mailer_spec.rb | 21 |
6 files changed, 26 insertions, 9 deletions
@@ -77,7 +77,6 @@ end group :develop do gem 'ruby-debug', :platforms => :ruby_18 gem 'debugger', :platforms => :ruby_19 - gem 'byebug', :platforms => :ruby_20 gem 'annotate' end diff --git a/Gemfile.lock b/Gemfile.lock index c5c1fa3b4..62258c0c6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,9 +51,6 @@ GEM bootstrap-sass (2.3.1.2) sass (~> 3.2) builder (3.0.4) - byebug (2.3.1) - columnize (~> 0.3.6) - debugger-linecache (~> 1.2.0) capistrano (2.15.4) highline net-scp (>= 1.0.0) @@ -281,7 +278,6 @@ DEPENDENCIES acts_as_versioned! annotate bootstrap-sass - byebug capistrano charlock_holmes coffee-rails (~> 3.2.1) @@ -19,7 +19,7 @@ drop a line to hello@alaveteli.org to let us know that you're using Alaveteli. Some documentation can be found in the [`doc/` folder](https://github.com/mysociety/alaveteli/tree/master/doc). -There's background information and a more documentation on +There's background information and more documentation on [our wiki](https://github.com/mysociety/alaveteli/wiki/Home/), and lots of useful information (including a blog) on [the project website](http://alaveteli.org) diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb index c8a19afa8..af1a75df9 100644 --- a/app/mailers/request_mailer.rb +++ b/app/mailers/request_mailer.rb @@ -19,7 +19,8 @@ class RequestMailer < ApplicationMailer end mail(:from => from_user.name_and_email, - :to => info_request.incoming_name_and_email) + :to => info_request.incoming_name_and_email, + :subject => info_request.email_subject_followup) end # Used when a response is uploaded using the API diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb index d2edc8dbe..a6d234b34 100644 --- a/app/views/comment/_single_comment.html.erb +++ b/app/views/comment/_single_comment.html.erb @@ -17,10 +17,10 @@ </div> <p class="event_actions"> <% if !comment.id.nil? %> - <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <% if !@user.nil? && @user.admin_page_links? %> - | <%= link_to "Admin", admin_request_edit_comment_path(comment) %> + <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> + <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> diff --git a/spec/mailers/request_mailer_spec.rb b/spec/mailers/request_mailer_spec.rb index 4e0765921..516d13127 100644 --- a/spec/mailers/request_mailer_spec.rb +++ b/spec/mailers/request_mailer_spec.rb @@ -332,6 +332,27 @@ describe RequestMailer, 'when sending mail when someone has updated an old uncla end +describe RequestMailer, 'when generating a fake response for an upload' do + + before do + @foi_officer = mock_model(User, :name_and_email => "FOI officer's name and email") + @request_user = mock_model(User) + @public_body = mock_model(PublicBody, :name => 'Test public body') + @info_request = mock_model(InfoRequest, :user => @request_user, + :email_subject_followup => 'Re: Freedom of Information - Test request', + :incoming_name_and_email => 'Someone <someone@example.org>') + end + + it 'should should generate a "fake response" email with a reasonable subject line' do + fake_email = RequestMailer.fake_response(@info_request, + @foi_officer, + "The body of the email...", + "blah.txt", + "The content of blah.txt") + fake_email.subject.should == "Re: Freedom of Information - Test request" + end + +end describe RequestMailer, 'when sending a new response email' do |