##// END OF EJS Templates
Replaces find(:first) calls....
Replaces find(:first) calls. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10930 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r9453:ba5a052c8ca8
r10703:a7023dfa9b8e
Show More
timelog_helper_test.rb
57 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
Copyright update....
r9453 # Copyright (C) 2006-2012 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
Toshi MARUYAMA
use ActionView::TestCase instead of HelperTestCase at timelog_helper_test.rb....
r5994 class TimelogHelperTest < ActionView::TestCase
Eric Davis
Changed the Timelogs to use both the Systemwide and Project specific TimeEntryActivities...
r2834 include TimelogHelper
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