comparison test/integration/layout_test.rb @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents cbb26bc654de
children 622f24f53b42
comparison
equal deleted inserted replaced
929:5f33065ddc4b 1115:433d4f72a19b
1 # Redmine - project management software
2 # Copyright (C) 2006-2012 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
1 require File.expand_path('../../test_helper', __FILE__) 18 require File.expand_path('../../test_helper', __FILE__)
2 19
3 class LayoutTest < ActionController::IntegrationTest 20 class LayoutTest < ActionController::IntegrationTest
4 fixtures :projects, :trackers, :issue_statuses, :issues, 21 fixtures :projects, :trackers, :issue_statuses, :issues,
5 :enumerations, :users, :issue_categories, 22 :enumerations, :users, :issue_categories,
18 # UsersController uses the admin layout by default 35 # UsersController uses the admin layout by default
19 assert_select "#admin-menu", :count => 0 36 assert_select "#admin-menu", :count => 0
20 end 37 end
21 38
22 test "browsing to an unauthorized page should render the base layout" do 39 test "browsing to an unauthorized page should render the base layout" do
23 change_user_password('miscuser9', 'test') 40 change_user_password('miscuser9', 'test1234')
24 41
25 log_user('miscuser9','test') 42 log_user('miscuser9','test1234')
26 43
27 get "/admin" 44 get "/admin"
28 assert_response :forbidden 45 assert_response :forbidden
29 assert_select "#admin-menu", :count => 0 46 assert_select "#admin-menu", :count => 0
30 end 47 end
48 def test_wiki_formatter_header_tags 65 def test_wiki_formatter_header_tags
49 Role.anonymous.add_permission! :add_issues 66 Role.anonymous.add_permission! :add_issues
50 67
51 get '/projects/ecookbook/issues/new' 68 get '/projects/ecookbook/issues/new'
52 assert_tag :script, 69 assert_tag :script,
53 :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}}, 70 :attributes => {:src => %r{^/javascripts/jstoolbar/jstoolbar-textile.min.js}},
54 :parent => {:tag => 'head'} 71 :parent => {:tag => 'head'}
55 end 72 end
73
74 def test_calendar_header_tags
75 with_settings :default_language => 'fr' do
76 get '/issues'
77 assert_include "/javascripts/i18n/jquery.ui.datepicker-fr.js", response.body
78 end
79
80 with_settings :default_language => 'en-GB' do
81 get '/issues'
82 assert_include "/javascripts/i18n/jquery.ui.datepicker-en-GB.js", response.body
83 end
84
85 with_settings :default_language => 'en' do
86 get '/issues'
87 assert_not_include "/javascripts/i18n/jquery.ui.datepicker", response.body
88 end
89 end
90
91 def test_search_field_outside_project_should_link_to_global_search
92 get '/'
93 assert_select 'div#quick-search form[action=/search]'
94 end
95
96 def test_search_field_inside_project_should_link_to_project_search
97 get '/projects/ecookbook'
98 assert_select 'div#quick-search form[action=/projects/ecookbook/search]'
99 end
56 end 100 end