mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 19:36:00 +01:00
Activity refactoring.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1701 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -153,10 +153,6 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
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}/,
|
||||
@@ -168,7 +164,9 @@ class ProjectsControllerTest < Test::Unit::TestCase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
def test_previous_project_activity
|
||||
get :activity, :id => 1, :from => 3.days.ago.to_date
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
@@ -186,53 +184,24 @@ 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
|
||||
def test_global_activity
|
||||
get :activity
|
||||
assert_response :success
|
||||
assert_template 'activity'
|
||||
assert_not_nil assigns(:events)
|
||||
assert_not_nil assigns(:events_by_day)
|
||||
|
||||
assert assigns(:events).include?(Issue.find(1))
|
||||
# Issue of a private project
|
||||
assert !assigns(:events).include?(Issue.find(4))
|
||||
assert_tag :tag => "h3",
|
||||
:content => /#{5.day.ago.to_date.day}/,
|
||||
:sibling => { :tag => "dl",
|
||||
:child => { :tag => "dt",
|
||||
:attributes => { :class => /issue/ },
|
||||
:child => { :tag => "a",
|
||||
:content => /#{Issue.find(5).subject}/,
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user