]> git.openstreetmap.org Git - rails.git/blob - test/functional/site_controller_test.rb
Merge branch 'master' into openid
[rails.git] / test / functional / site_controller_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 class SiteControllerTest < ActionController::TestCase
4   ## Lets check that we can get all the pages without any errors
5   
6   # Get the index
7   def test_index
8     get :index
9     assert_response :success
10     assert_template 'index'
11     assert_site_partials
12   end
13   
14   # Get the edit page
15   def test_edit
16     get :edit
17     # Should be redirected
18     assert_redirected_to :controller => :user, :action => 'login', :referer => "/edit"
19   end
20   
21   # Get the export page
22   def test_export
23     get :export
24     assert_response :success
25     assert_template 'index'
26     assert_site_partials
27   end
28   
29   # Offline page
30   def test_offline
31     get :offline
32     assert_response :success
33     assert_template 'offline'
34     assert_site_partials 0
35   end
36   
37   def assert_site_partials(count = 1)
38     assert_template :partial => '_search', :count => count
39     assert_template :partial => '_key', :count => count
40     assert_template :partial => '_sidebar', :count => count
41   end
42 end