def reminder(user, issues, days)
@issues = issues
@days = days
- @issues_url = url_for(:controller => 'issues', :action => 'index',
+ @open_issues_url = url_for(:controller => 'issues', :action => 'index',
:set_filter => 1, :assigned_to_id => 'me',
:sort => 'due_date:asc')
+ @reminder_issues_url = url_for(:controller => 'issues', :action => 'index',
+ :set_filter => 1, :sort => 'due_date:asc',
+ :f => ['status_id', 'assigned_to_id', "due_date"],
+ :op => {'status_id' => 'o', 'assigned_to_id' => '=', 'due_date' => '<t+'},
+ :v =>{'assigned_to_id' => ['me'], 'due_date' => [days]})
+
query = IssueQuery.new(:name => '_')
query.add_filter('assigned_to_id', '=', ['me'])
@open_issues_count = query.issue_count
-<p><%= l(:mail_body_reminder, :count => @issues.size, :days => @days) %></p>
+<p><%= l(:mail_body_reminder, :count => link_to(@issues.size, @reminder_issues_url), :days => @days).html_safe %></p>
<ul>
<% @issues.each do |issue| -%>
<% end -%>
</ul>
-<p><%= link_to l(:label_issue_view_all), @issues_url %> (<%= l(:label_x_open_issues_abbr, :count => @open_issues_count) %>)</p>
+<p><%= link_to l(:label_issue_view_all), @open_issues_url %> (<%= l(:label_x_open_issues_abbr, :count => @open_issues_count) %>)</p>
<% end -%>
<%= l(:label_issue_view_all)%> (<%= l(:label_x_open_issues_abbr, :count => @open_issues_count) %>)
-<%= @issues_url %>
+<%= @open_issues_url %>
def test_reminders
users(:users_003).pref.update_attribute :time_zone, 'UTC' # dlopper
- Mailer.reminders(:days => 42)
+ days = 42
+ Mailer.reminders(:days => days)
assert_equal 1, ActionMailer::Base.deliveries.size
mail = last_email
assert mail.bcc.include?('dlopper@somenet.foo')
assert_mail_body_match 'Bug #3: Error 281 when updating a recipe (5 days late)', mail
assert_mail_body_match 'View all issues (2 open)', mail
assert_select_email do
+ assert_select 'a[href=?]',
+ "http://localhost:3000/issues?f%5B%5D=status_id&f%5B%5D=assigned_to_id&f%5B%5D=due_date&op%5Bassigned_to_id%5D=%3D&op%5Bdue_date%5D=%3Ct%2B&op%5Bstatus_id%5D=o&set_filter=1&sort=due_date%3Aasc&v%5Bassigned_to_id%5D%5B%5D=me&v%5Bdue_date%5D%5B%5D=#{days}",
+ :text => '1'
assert_select 'a[href=?]',
'http://localhost:3000/issues?assigned_to_id=me&set_filter=1&sort=due_date%3Aasc',
:text => 'View all issues'
assert_select '/p:nth-last-of-type(1)', :text => 'View all issues (2 open)'
end
- assert_equal '1 issue(s) due in the next 42 days', mail.subject
+ assert_equal "1 issue(s) due in the next #{days} days", mail.subject
end
def test_reminders_language_auto