##// END OF EJS Templates
Speeds up rendering of the project list for users who belong to hundreds of projects....
Speeds up rendering of the project list for users who belong to hundreds of projects. git-svn-id: http://svn.redmine.org/redmine/trunk@16123 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r15301:c4b4b8a71e21
r15741:f8df935dcada
Show More
timelog_helper_test.rb
58 lines | 2.4 KiB | text/x-ruby | RubyLexer
/ test / unit / helpers / timelog_helper_test.rb
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657 #
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657 #
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../../test_helper', __FILE__)
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834
Jean-Philippe Lang
Adds a class for testing helpers....
r15301 class TimelogHelperTest < Redmine::HelperTest
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 include TimelogHelper
Jean-Philippe Lang
Include Redmine::I18n in helpers tests....
r11645 include Redmine::I18n
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 include ActionView::Helpers::TextHelper
include ActionView::Helpers::DateHelper
Jean-Philippe Lang
Include ERB::Util in helpers tests....
r8970 include ERB::Util
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 fixtures :projects, :roles, :enabled_modules, :users,
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657 :repositories, :changesets,
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 :trackers, :issue_statuses, :issues, :versions, :documents,
:wikis, :wiki_pages, :wiki_contents,
:boards, :messages,
:attachments,
:enumerations
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 def setup
super
end
def test_activities_collection_for_select_options_should_return_array_of_activity_names_and_ids
activities = activity_collection_for_select_options
assert activities.include?(["Design", 9])
assert activities.include?(["Development", 10])
end
Toshi MARUYAMA
remove trailing white-spaces from test/unit/helpers/timelog_helper_test.rb....
r6657
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 def test_activities_collection_for_select_options_should_not_include_inactive_activities
activities = activity_collection_for_select_options
assert !activities.include?(["Inactive Activity", 14])
end
def test_activities_collection_for_select_options_should_use_the_projects_override
project = Project.find(1)
override_activity = TimeEntryActivity.create!({:name => "Design override", :parent => TimeEntryActivity.find_by_name("Design"), :project => project})
activities = activity_collection_for_select_options(nil, project)
assert !activities.include?(["Design", 9]), "System activity found in: " + activities.inspect
assert activities.include?(["Design override", override_activity.id]), "Override activity not found in: " + activities.inspect
end
end