Skip to content

Commit

Permalink
Merge 5e4ef66 into 193d786
Browse files Browse the repository at this point in the history
  • Loading branch information
glekner committed Jan 7, 2019
2 parents 193d786 + 5e4ef66 commit 8cc3079
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/views/audit_mailer/summary.html.erb
Expand Up @@ -11,10 +11,10 @@
<%= link_to(audit.username, audits_url(:search => user_search_param)) %>
<span style="color: #cccccc"><%= audit_remote_address audit %></span>
<%= audit_action_name audit%> <%= audited_type audit %>:
<%= link_to(audit_title(audit), audit_url(:id => audit), {:style => 'color: #2a6496'}) %>
<%= link_to(audit_title(audit), audits_url(search: "id = #{audit.id}"), {:style => 'color: #2a6496'}) %>
</b>
<ul style="list-style-type: none;">
<% details(audit, audit_url(audit)).each do |detail| -%>
<% details(audit, audits_url(search: "id = #{audit.id}")).each do |detail| -%>
<li>
<%= detail %>
</li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/audit_mailer/summary.text.erb
Expand Up @@ -5,7 +5,7 @@
'Displaying %{num_audits} of %{total_audits} audits', @count) % {:num_audits => @limit, :total_audits => @count} %>
<% @audits.each do |audit| %>
<%= audit.username %> (<%= audit.remote_address %>) <%= audit_action_name audit%> <%= audited_type audit %>: <%= audit_title(audit) %>
(<%= audit_url(:id => audit) %>)
(<%= audits_url(search: "id = #{audit}") %>)
<% end %>
<% else %>
<%= _('No audit changes for this period') %>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Expand Up @@ -264,7 +264,7 @@
end
end

resources :audits do
resources :audits, :only => [:index] do
collection do
get 'auto_complete_search'
end
Expand Down
6 changes: 6 additions & 0 deletions test/mailers/audit_mailer_test.rb
Expand Up @@ -47,6 +47,12 @@ def setup
assert_includes(AuditMailer.summary(@options).deliver_now.body.parts.last.body, query_should_be)
end

test 'Audit html mail should include correct id query' do
@options[:query] = 'id = 21'
query_should_be = CGI.escape(@options[:query])
assert_includes(AuditMailer.summary(@options).deliver_now.body.parts.last.body, query_should_be)
end

test "Audit template change should not crash" do
template = FactoryBot.create(:provisioning_template, :template => 'aaaa', :name => 'audited ptable', :snippet => true)
template.update(:template => 'bbbbbb')
Expand Down
Expand Up @@ -61,6 +61,7 @@ exports[`AuditsList rendering render resources list 1`] = `
}
hideCloseIcon={true}
id={234}
initExpanded={false}
key="234"
leftContent={null}
onCloseCompoundExpand={[Function]}
Expand Down

0 comments on commit 8cc3079

Please sign in to comment.