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