edit_template_controller_test.rb
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# FIXME: this tests must me moved into design plugin
require File.dirname(__FILE__) + '/../test_helper'
require 'edit_template_controller'
# Re-raise errors caught by the controller.
class EditTemplateController; def rescue_action(e) raise e end; end
class EditTemplateControllerTest < Test::Unit::TestCase
  all_fixtures
  def setup
    @controller = EditTemplateController.new
    @request    = ActionController::TestRequest.new
    @request.stubs(:ssl?).returns(true)
    @response   = ActionController::TestResponse.new
    login_as 'ze'
  end
  def test_local_files_reference
    assert_local_files_reference
  end
  
  def test_valid_xhtml
    assert_valid_xhtml
  end
  
  def test_redirect_to_design_editor_when_index_action_is_called
    give_permission('ze', 'edit_environment_design', Environment.default)
    get :index
    assert_response :redirect
    assert_redirected_to :action => 'design_editor'
  end
  #############################################################
  # FIXME: design_editor stuff, move to design plugin
  #############################################################
end