Mercurial > hg > soundsoftware-site
comparison .svn/pristine/d1/d135034b3f55af6d92fe20dfa38d8a5ebacd0d27.svn-base @ 1494:e248c7af89ec redmine-2.4
Update to Redmine SVN revision 12979 on 2.4-stable branch
author | Chris Cannam |
---|---|
date | Mon, 17 Mar 2014 08:54:02 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1464:261b3d9a4903 | 1494:e248c7af89ec |
---|---|
1 # Redmine - project management software | |
2 # Copyright (C) 2006-2014 Jean-Philippe Lang | |
3 # | |
4 # This program is free software; you can redistribute it and/or | |
5 # modify it under the terms of the GNU General Public License | |
6 # as published by the Free Software Foundation; either version 2 | |
7 # of the License, or (at your option) any later version. | |
8 # | |
9 # This program is distributed in the hope that it will be useful, | |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 # GNU General Public License for more details. | |
13 # | |
14 # You should have received a copy of the GNU General Public License | |
15 # along with this program; if not, write to the Free Software | |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 | |
18 require File.expand_path('../../../test_helper', __FILE__) | |
19 | |
20 class TimelogHelperTest < ActionView::TestCase | |
21 include TimelogHelper | |
22 include Redmine::I18n | |
23 include ActionView::Helpers::TextHelper | |
24 include ActionView::Helpers::DateHelper | |
25 include ERB::Util | |
26 | |
27 fixtures :projects, :roles, :enabled_modules, :users, | |
28 :repositories, :changesets, | |
29 :trackers, :issue_statuses, :issues, :versions, :documents, | |
30 :wikis, :wiki_pages, :wiki_contents, | |
31 :boards, :messages, | |
32 :attachments, | |
33 :enumerations | |
34 | |
35 def setup | |
36 super | |
37 end | |
38 | |
39 def test_activities_collection_for_select_options_should_return_array_of_activity_names_and_ids | |
40 activities = activity_collection_for_select_options | |
41 assert activities.include?(["Design", 9]) | |
42 assert activities.include?(["Development", 10]) | |
43 end | |
44 | |
45 def test_activities_collection_for_select_options_should_not_include_inactive_activities | |
46 activities = activity_collection_for_select_options | |
47 assert !activities.include?(["Inactive Activity", 14]) | |
48 end | |
49 | |
50 def test_activities_collection_for_select_options_should_use_the_projects_override | |
51 project = Project.find(1) | |
52 override_activity = TimeEntryActivity.create!({:name => "Design override", :parent => TimeEntryActivity.find_by_name("Design"), :project => project}) | |
53 | |
54 activities = activity_collection_for_select_options(nil, project) | |
55 assert !activities.include?(["Design", 9]), "System activity found in: " + activities.inspect | |
56 assert activities.include?(["Design override", override_activity.id]), "Override activity not found in: " + activities.inspect | |
57 end | |
58 end |