summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-03-08 14:31:15 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-03-08 14:31:15 +0000
commit4f4d447224a404919441371d71533bcfed78d853 (patch)
treedb5d752ae91c53750e0f3606ed12785a2b9f3dcd /test/unit
parent9701c335628e244d0e08d3383e330331070cce4b (diff)
downloadredmine-4f4d447224a404919441371d71533bcfed78d853.tar.gz
redmine-4f4d447224a404919441371d71533bcfed78d853.zip
Fixed: Files without Version aren't visible in the Activity page (#2930).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2569 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/activity_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/unit/activity_test.rb b/test/unit/activity_test.rb
index e5bc0d266..d47694e48 100644
--- a/test/unit/activity_test.rb
+++ b/test/unit/activity_test.rb
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper'
class ActivityTest < Test::Unit::TestCase
- fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details,
+ fixtures :projects, :versions, :attachments, :users, :roles, :members, :issues, :journals, :journal_details,
:trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
def setup
@@ -72,6 +72,18 @@ class ActivityTest < Test::Unit::TestCase
assert_nil(events.detect {|e| e.event_author != user})
end
+ def test_files_activity
+ f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
+ f.scope = ['files']
+ events = f.events
+
+ assert_kind_of Array, events
+ assert events.include?(Attachment.find_by_container_type_and_container_id('Project', 1))
+ assert events.include?(Attachment.find_by_container_type_and_container_id('Version', 1))
+ assert_equal [Attachment], events.collect(&:class).uniq
+ assert_equal %w(Project Version), events.collect(&:container_type).uniq.sort
+ end
+
private
def find_events(user, options={})