From: Jean-Philippe Lang Date: Sun, 29 May 2011 07:47:25 +0000 (+0000) Subject: Merged r5944 from trunk. X-Git-Tag: 1.2.0~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fabf54a3680145b269c7c403bca2c6ef452ed8fc;p=redmine.git Merged r5944 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@5947 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/journal.rb b/app/models/journal.rb index cb5aad21a..d0f7cc030 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -32,7 +32,6 @@ class Journal < ActiveRecord::Base :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}} acts_as_activity_provider :type => 'issues', - :permission => :view_issues, :author_key => :user_id, :find_options => {:include => [{:issue => :project}, :details, :user], :conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" + diff --git a/test/fixtures/journals.yml b/test/fixtures/journals.yml index 48280f840..5bc81e41c 100644 --- a/test/fixtures/journals.yml +++ b/test/fixtures/journals.yml @@ -27,3 +27,10 @@ journals_004: journalized_type: Issue user_id: 1 journalized_id: 6 +journals_005: + id: 5 + created_on: <%= 1.days.ago.to_date.to_s(:db) %> + notes: "A comment on a private issue." + user_id: 2 + journalized_type: Issue + journalized_id: 14 diff --git a/test/unit/activity_test.rb b/test/unit/activity_test.rb index 4978142ab..2ecc68848 100644 --- a/test/unit/activity_test.rb +++ b/test/unit/activity_test.rb @@ -52,6 +52,9 @@ class ActivityTest < ActiveSupport::TestCase assert events.include?(Message.find(5)) # Issue of a private project assert !events.include?(Issue.find(4)) + # Private issue and comment + assert !events.include?(Issue.find(14)) + assert !events.include?(Journal.find(5)) end def test_global_activity_logged_user