source: subversion/sites/rails_port/test/functional/site_controller_test.rb @ 17044

Last change on this file since 17044 was 15761, checked in by Shaun McDonald, 10 years ago

Make some links more rails like, thus easier to read. Test that partials are included as expected.

File size: 1010 bytes
Line 
1require File.dirname(__FILE__) + '/../test_helper'
2
3class 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
42end
Note: See TracBrowser for help on using the repository browser.