@@ -38,7 +38,7 class Journal < ActiveRecord::Base | |||
|
38 | 38 | :scope => preload({:issue => :project}, :user). |
|
39 | 39 | joins("LEFT OUTER JOIN #{JournalDetail.table_name} ON #{JournalDetail.table_name}.journal_id = #{Journal.table_name}.id"). |
|
40 | 40 | where("#{Journal.table_name}.journalized_type = 'Issue' AND" + |
|
41 | " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')") | |
|
41 | " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')").uniq | |
|
42 | 42 | |
|
43 | 43 | before_create :split_private_notes |
|
44 | 44 | after_create :send_notification |
@@ -76,6 +76,14 class ActivityTest < ActiveSupport::TestCase | |||
|
76 | 76 | assert_nil(events.detect {|e| e.event_author != user}) |
|
77 | 77 | end |
|
78 | 78 | |
|
79 | def test_journal_with_notes_and_changes_should_be_returned_once | |
|
80 | f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1)) | |
|
81 | f.scope = ['issues'] | |
|
82 | events = f.events | |
|
83 | ||
|
84 | assert_equal events, events.uniq | |
|
85 | end | |
|
86 | ||
|
79 | 87 | def test_files_activity |
|
80 | 88 | f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1)) |
|
81 | 89 | f.scope = ['files'] |
General Comments 0
You need to be logged in to leave comments.
Login now