Feature #31109 » prominent-the-assignee.patch
| app/views/mailer/issue_add.html.erb | ||
|---|---|---|
|
<%= l(:text_issue_added, :id => link_to("##{@issue.id}", @issue_url), :author => h(@issue.author)).html_safe %>
|
||
|
<%= l(:text_issue_added, :id => link_to("##{@issue.id}", @issue_url), :author => h(@issue.author),
|
||
|
:assignee => (h(' (%s: %s)' % [l(:field_assigned_to), @issue.assigned_to]) if @issue.assigned_to)).html_safe %>
|
||
|
<hr />
|
||
|
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :user => @user, :issue_url => @issue_url } %>
|
||
| app/views/mailer/issue_add.text.erb | ||
|---|---|---|
|
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => @issue.author) %>
|
||
|
<%= l(:text_issue_added, :id => "##{@issue.id}", :author => @issue.author,
|
||
|
:assignee => (' (%s: %s)' % [l(:field_assigned_to), @issue.assigned_to] if @issue.assigned_to)) %>
|
||
|
----------------------------------------
|
||
|
<%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :user => @user, :issue_url => @issue_url } %>
|
||
| app/views/mailer/issue_edit.html.erb | ||
|---|---|---|
|
<% if @journal.private_notes? %>
|
||
|
(<%= l(:field_private_notes) %>)
|
||
|
<% end %>
|
||
|
<%= l(:text_issue_updated, :id => link_to("##{@issue.id}", @issue_url), :author => h(@journal.user)).html_safe %>
|
||
|
<%= l(:text_issue_updated, :id => link_to("##{@issue.id}", @issue_url), :author => h(@journal.user),
|
||
|
:assignee => (h(' (%s: %s)' % [l(:field_assigned_to), @issue.assigned_to]) if @issue.assigned_to)).html_safe %>
|
||
|
<hr />
|
||
|
<ul class="journal details">
|
||
| app/views/mailer/issue_edit.text.erb | ||
|---|---|---|
|
<%= "(#{l(:field_private_notes)}) " if @journal.private_notes? -%><%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
|
||
|
<%= "(#{l(:field_private_notes)}) " if @journal.private_notes? -%><%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user,
|
||
|
:assignee => (' (%s: %s)' % [l(:field_assigned_to), @issue.assigned_to] if @issue.assigned_to)) %>
|
||
|
<% details_to_strings(@journal_details, true).each do |string| -%>
|
||
|
<%= string %>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
text_comma_separated: Multiple values allowed (comma separated).
|
||
|
text_line_separated: Multiple values allowed (one line for each value).
|
||
|
text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages
|
||
|
text_issue_added: "Issue %{id} has been reported by %{author}."
|
||
|
text_issue_updated: "Issue %{id} has been updated by %{author}."
|
||
|
text_issue_added: "Issue %{id}%{assignee} has been reported by %{author}."
|
||
|
text_issue_updated: "Issue %{id}%{assignee} has been updated by %{author}."
|
||
|
text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and all its content?
|
||
|
text_issue_category_destroy_question: "Some issues (%{count}) are assigned to this category. What do you want to do?"
|
||
|
text_issue_category_destroy_assignments: Remove category assignments
|
||
| test/unit/mailer_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_issue_add_should_show_assignee_at_beginning_of_mailbody
|
||
|
user_jsmith = User.find_by_login('jsmith')
|
||
|
user_dlopper = User.find_by_login('dlopper')
|
||
|
issue = Issue.generate!(:assigned_to_id => nil, :author_id => user_jsmith.id)
|
||
|
ActionMailer::Base.deliveries.clear
|
||
|
Mailer.deliver_issue_add(issue)
|
||
|
expect = /Issue ##{issue.id} has been reported by John Smith\./
|
||
|
assert_mail_body_match /\A#{expect}/, last_email
|
||
|
assert_select_email do
|
||
|
assert_select 'body', :text => expect
|
||
|
end
|
||
|
issue = Issue.generate!(:assigned_to_id => user_dlopper.id, :author_id => user_jsmith.id)
|
||
|
ActionMailer::Base.deliveries.clear
|
||
|
Mailer.deliver_issue_add(issue)
|
||
|
expect = /Issue ##{issue.id} \(Assignee: Dave Lopper\) has been reported by John Smith\./
|
||
|
assert_mail_body_match /\A#{expect}/, last_email
|
||
|
assert_select_email do
|
||
|
assert_select 'body', :text => expect
|
||
|
end
|
||
|
end
|
||
|
def test_issue_edit_should_show_assignee_at_beginning_of_mailbody
|
||
|
user_jsmith = User.find_by_login('jsmith')
|
||
|
user_dlopper = User.find_by_login('dlopper')
|
||
|
issue = Issue.find(1)
|
||
|
issue.update_attributes(:author_id => user_dlopper.id)
|
||
|
issue.update_attributes(:assigned_to_id => nil)
|
||
|
issue.init_journal(user_jsmith)
|
||
|
issue.reload
|
||
|
journal = issue.journals.last
|
||
|
ActionMailer::Base.deliveries.clear
|
||
|
Mailer.deliver_issue_edit(journal)
|
||
|
expect = /Issue #1 has been updated by John Smith\./
|
||
|
assert_mail_body_match /\A#{expect}/, last_email
|
||
|
assert_select_email do
|
||
|
assert_select 'body', :text => expect
|
||
|
end
|
||
|
issue.update_attributes(:assigned_to_id => user_dlopper.id)
|
||
|
issue.init_journal(user_jsmith)
|
||
|
issue.reload
|
||
|
journal = issue.journals.last
|
||
|
ActionMailer::Base.deliveries.clear
|
||
|
Mailer.deliver_issue_edit(journal)
|
||
|
expect = /Issue #1 \(Assignee: Dave Lopper\) has been updated by John Smith\./
|
||
|
assert_mail_body_match /\A#{expect}/, last_email
|
||
|
assert_select_email do
|
||
|
assert_select 'body', :text => expect
|
||
|
end
|
||
|
end
|
||
|
def test_version_file_added
|
||
|
attachements = [ Attachment.find_by_container_type('Version') ]
|
||
|
assert Mailer.deliver_attachments_added(attachements)
|
||