##// END OF EJS Templates
fix ProjectsHelperTest fails when config.threadsafe! is enabled (#12097)...
Toshi MARUYAMA -
r12895:bbaccc347b08
parent child
Show More
@@ -1,77 +1,78
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../../test_helper', __FILE__)
19 19
20 20 class ProjectsHelperTest < ActionView::TestCase
21 21 include ApplicationHelper
22 22 include ProjectsHelper
23 23 include Redmine::I18n
24 24 include ERB::Util
25 include Rails.application.routes.url_helpers
25 26
26 27 fixtures :projects, :trackers, :issue_statuses, :issues,
27 28 :enumerations, :users, :issue_categories,
28 29 :versions,
29 30 :projects_trackers,
30 31 :member_roles,
31 32 :members,
32 33 :groups_users,
33 34 :enabled_modules
34 35
35 36 def setup
36 37 super
37 38 set_language_if_valid('en')
38 39 User.current = nil
39 40 end
40 41
41 42 def test_link_to_version_within_project
42 43 @project = Project.find(2)
43 44 User.current = User.find(1)
44 45 assert_equal '<a href="/versions/5">Alpha</a>', link_to_version(Version.find(5))
45 46 end
46 47
47 48 def test_link_to_version
48 49 User.current = User.find(1)
49 50 assert_equal '<a href="/versions/5">OnlineStore - Alpha</a>', link_to_version(Version.find(5))
50 51 end
51 52
52 53 def test_link_to_private_version
53 54 assert_equal 'OnlineStore - Alpha', link_to_version(Version.find(5))
54 55 end
55 56
56 57 def test_link_to_version_invalid_version
57 58 assert_equal '', link_to_version(Object)
58 59 end
59 60
60 61 def test_format_version_name_within_project
61 62 @project = Project.find(1)
62 63 assert_equal "0.1", format_version_name(Version.find(1))
63 64 end
64 65
65 66 def test_format_version_name
66 67 assert_equal "eCookbook - 0.1", format_version_name(Version.find(1))
67 68 end
68 69
69 70 def test_format_version_name_for_system_version
70 71 assert_equal "OnlineStore - Systemwide visible version", format_version_name(Version.find(7))
71 72 end
72 73
73 74 def test_version_options_for_select_with_no_versions
74 75 assert_equal '', version_options_for_select([])
75 76 assert_equal '', version_options_for_select([], Version.find(1))
76 77 end
77 78 end
General Comments 0
You need to be logged in to leave comments. Login now