gem "rails-dom-testing"
gem "mocha"
gem "simplecov", "~> 0.9.1", :require => false
+ # TODO: remove this after upgrading to Rails 5
+ gem "test_after_commit"
# For running UI tests
gem "capybara"
gem "selenium-webdriver", "~> 2.53.4"
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").distinct
before_create :split_private_notes
- after_create :send_notification
+ after_commit :send_notification, :on => :create
scope :visible, lambda {|*args|
user = args.shift || User.current
<%= l(:text_issue_updated, :id => link_to("##{@issue.id}", @issue_url), :author => h(@journal.user)).html_safe %>
<hr />
-<ul class="details">
+<ul class="journal details">
<% details_to_strings(@journal_details, false, :only_path => false).each do |string| %>
<li><%= string %></li>
<% end %>
def test_put_update_with_attachment_deletion_should_create_a_single_journal
set_tmp_attachments_directory
+ ActionMailer::Base.deliveries.clear
@request.session[:user_id] = 2
journal = new_record(Journal) do
end
assert_equal 'Removing attachments', journal.notes
assert_equal 2, journal.details.count
+
+ assert_select_email do
+ assert_select 'ul.journal.details li', 2
+ assert_select 'del', :text => 'error281.txt'
+ assert_select 'del', :text => 'changeset_iso8859-1.diff'
+ end
end
def test_put_update_with_attachment_deletion_and_failure_should_preserve_selected_attachments