Activity enhancements:
* overall activity view and feed added, link is available on the project list (#423, #494) * switch added on the project activity view to include subprojects (closes #530) git-svn-id: http://redmine.rubyforge.org/svn/trunk@1227 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Vendored
+16
-2
@@ -44,9 +44,9 @@ issues_003:
|
||||
start_date: <%= 1.day.from_now.to_date.to_s(:db) %>
|
||||
due_date: <%= 40.day.ago.to_date.to_s(:db) %>
|
||||
issues_004:
|
||||
created_on: 2006-07-19 21:07:27 +02:00
|
||||
created_on: <%= 5.days.ago.to_date.to_s(:db) %>
|
||||
project_id: 2
|
||||
updated_on: 2006-07-19 21:07:27 +02:00
|
||||
updated_on: <%= 2.days.ago.to_date.to_s(:db) %>
|
||||
priority_id: 4
|
||||
subject: Issue on project 2
|
||||
id: 4
|
||||
@@ -57,4 +57,18 @@ issues_004:
|
||||
assigned_to_id:
|
||||
author_id: 2
|
||||
status_id: 1
|
||||
issues_005:
|
||||
created_on: <%= 5.days.ago.to_date.to_s(:db) %>
|
||||
project_id: 3
|
||||
updated_on: <%= 2.days.ago.to_date.to_s(:db) %>
|
||||
priority_id: 4
|
||||
subject: Subproject issue
|
||||
id: 5
|
||||
fixed_version_id:
|
||||
category_id:
|
||||
description: This is an issue on a cookbook subproject
|
||||
tracker_id: 1
|
||||
assigned_to_id:
|
||||
author_id: 2
|
||||
status_id: 1
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -45,8 +45,8 @@ messages_004:
|
||||
parent_id:
|
||||
board_id: 1
|
||||
messages_005:
|
||||
created_on: 2007-09-12 17:18:00 +02:00
|
||||
updated_on: 2007-09-12 17:18:00 +02:00
|
||||
created_on: <%= 3.days.ago.to_date.to_s(:db) %>
|
||||
updated_on: <%= 3.days.ago.to_date.to_s(:db) %>
|
||||
subject: 'RE: post 2'
|
||||
id: 5
|
||||
replies_count: 0
|
||||
|
||||
@@ -22,7 +22,8 @@ require 'projects_controller'
|
||||
class ProjectsController; def rescue_action(e) raise e end; end
|
||||
|
||||
class ProjectsControllerTest < Test::Unit::TestCase
|
||||
fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations
|
||||
fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details,
|
||||
:trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
|
||||
|
||||
def setup
|
||||
@controller = ProjectsController.new
|
||||
@@ -129,11 +130,15 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
assert assigns(:versions).include?(Version.find(1))
|
||||
end
|
||||
|
||||
def test_activity
|
||||
get :activity, :id => 1
|
||||
def test_project_activity
|
||||
get :activity, :id => 1, :with_subprojects => 0
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events_by_day)
|
||||
assert_not_nil assigns(:events)
|
||||
|
||||
# subproject issue not included by default
|
||||
assert !assigns(:events).include?(Issue.find(5))
|
||||
|
||||
assert_tag :tag => "h3",
|
||||
:content => /#{2.days.ago.to_date.day}/,
|
||||
@@ -163,6 +168,53 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
}
|
||||
end
|
||||
|
||||
def test_activity_with_subprojects
|
||||
get :activity, :id => 1, :with_subprojects => 1
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events)
|
||||
|
||||
assert assigns(:events).include?(Issue.find(1))
|
||||
assert !assigns(:events).include?(Issue.find(4))
|
||||
# subproject issue
|
||||
assert assigns(:events).include?(Issue.find(5))
|
||||
end
|
||||
|
||||
def test_global_activity_anonymous
|
||||
get :activity
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events)
|
||||
|
||||
assert assigns(:events).include?(Issue.find(1))
|
||||
# Issue of a private project
|
||||
assert !assigns(:events).include?(Issue.find(4))
|
||||
end
|
||||
|
||||
def test_global_activity_logged_user
|
||||
@request.session[:user_id] = 2 # manager
|
||||
get :activity
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events)
|
||||
|
||||
assert assigns(:events).include?(Issue.find(1))
|
||||
# Issue of a private project the user belongs to
|
||||
assert assigns(:events).include?(Issue.find(4))
|
||||
end
|
||||
|
||||
|
||||
def test_global_activity_with_all_types
|
||||
get :activity, :show_issues => 1, :show_news => 1, :show_files => 1, :show_documents => 1, :show_changesets => 1, :show_wiki_pages => 1, :show_messages => 1
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events)
|
||||
|
||||
assert assigns(:events).include?(Issue.find(1))
|
||||
assert !assigns(:events).include?(Issue.find(4))
|
||||
assert assigns(:events).include?(Message.find(5))
|
||||
end
|
||||
|
||||
def test_calendar
|
||||
get :calendar, :id => 1
|
||||
assert_response :success
|
||||
|
||||
@@ -126,13 +126,4 @@ class ProjectTest < Test::Unit::TestCase
|
||||
assert_equal [1, 2, 3], parent.rolled_up_trackers.collect(&:id)
|
||||
assert_equal [2, 3], child.rolled_up_trackers.collect(&:id)
|
||||
end
|
||||
|
||||
def test_issues_status_changes
|
||||
journals = @ecookbook.issues_status_changes 3.days.ago.to_date, Date.today
|
||||
assert_equal 1, journals.size
|
||||
assert_kind_of Journal, journals.first
|
||||
|
||||
journals = @ecookbook.issues_status_changes 30.days.ago.to_date, 10.days.ago.to_date
|
||||
assert_equal 0, journals.size
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user