@@ -1,49 +1,56 | |||
|
1 | 1 | require File.expand_path('../../test_helper', __FILE__) |
|
2 | 2 | |
|
3 | 3 | class LayoutTest < ActionController::IntegrationTest |
|
4 | fixtures :all | |
|
4 | fixtures :projects, :trackers, :issue_statuses, :issues, | |
|
5 | :enumerations, :users, :issue_categories, | |
|
6 | :projects_trackers, | |
|
7 | :roles, | |
|
8 | :member_roles, | |
|
9 | :members, | |
|
10 | :enabled_modules, | |
|
11 | :workflows | |
|
5 | 12 | |
|
6 | 13 | test "browsing to a missing page should render the base layout" do |
|
7 | 14 | get "/users/100000000" |
|
8 | 15 | |
|
9 | 16 | assert_response :not_found |
|
10 | 17 | |
|
11 | 18 | # UsersController uses the admin layout by default |
|
12 | 19 | assert_select "#admin-menu", :count => 0 |
|
13 | 20 | end |
|
14 | 21 | |
|
15 | 22 | test "browsing to an unauthorized page should render the base layout" do |
|
16 | 23 | change_user_password('miscuser9', 'test') |
|
17 | 24 | |
|
18 | 25 | log_user('miscuser9','test') |
|
19 | 26 | |
|
20 | 27 | get "/admin" |
|
21 | 28 | assert_response :forbidden |
|
22 | 29 | assert_select "#admin-menu", :count => 0 |
|
23 | 30 | end |
|
24 | 31 | |
|
25 | 32 | def test_top_menu_and_search_not_visible_when_login_required |
|
26 | 33 | with_settings :login_required => '1' do |
|
27 | 34 | get '/' |
|
28 | 35 | assert_select "#top-menu > ul", 0 |
|
29 | 36 | assert_select "#quick-search", 0 |
|
30 | 37 | end |
|
31 | 38 | end |
|
32 | 39 | |
|
33 | 40 | def test_top_menu_and_search_visible_when_login_not_required |
|
34 | 41 | with_settings :login_required => '0' do |
|
35 | 42 | get '/' |
|
36 | 43 | assert_select "#top-menu > ul" |
|
37 | 44 | assert_select "#quick-search" |
|
38 | 45 | end |
|
39 | 46 | end |
|
40 | 47 | |
|
41 | 48 | def test_wiki_formatter_header_tags |
|
42 | 49 | Role.anonymous.add_permission! :add_issues |
|
43 | 50 | |
|
44 | 51 | get '/projects/ecookbook/issues/new' |
|
45 | 52 | assert_tag :script, |
|
46 | 53 | :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}}, |
|
47 | 54 | :parent => {:tag => 'head'} |
|
48 | 55 | end |
|
49 | 56 | end |
General Comments 0
You need to be logged in to leave comments.
Login now