Sha256: 4d883f19216d01e1ade27dd201e805131dd69aee9d9de11a3827ce23e18edbce

Contents?: true

Size: 1.41 KB

Versions: 9

Compression:

Stored size: 1.41 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'theme_controller'

# Re-raise errors caught by the controller.
class ThemeController; def rescue_action(e) raise e end; end

class ThemeControllerTest < Test::Unit::TestCase
  def setup
    @controller = ThemeController.new
    @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new
  end

  def test_stylesheets
    get :stylesheets, :filename => "azure.css"
    assert_response :success
    assert_equal "text/css", @response.headers['Content-Type']
    assert_equal "inline; filename=\"azure.css\"", @response.headers['Content-Disposition']
  end

  def test_images
    get :images, :filename => "bg-tile.gif"
    assert_response :success
    assert_equal "image/gif", @response.headers['Content-Type']
    assert_equal "inline; filename=\"bg-tile.gif\"", @response.headers['Content-Disposition']
  end

  def test_malicious_path
    get :stylesheets, :filename => "../../../config/database.yml"
    assert_response 404
  end

  def test_view_theming
    get :static_view_test
    assert_response :success

    assert @response.body =~ /Static View Test from azure/
  end

  def disabled_test_javascript
    get :stylesheets, :filename => "typo.js"
    assert_response :success
    assert_equal "text/javascript", @response.headers['Content-Type']
    assert_equal "inline; filename=\"typo.js\"", @response.headers['Content-Disposition']
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
typo-3.99.0 test/functional/theme_controller_test.rb
typo-3.99.2 test/functional/theme_controller_test.rb
typo-3.99.3 test/functional/theme_controller_test.rb
typo-3.99.1 test/functional/theme_controller_test.rb
typo-3.99.4 test/functional/theme_controller_test.rb
typo-4.0.0 test/functional/theme_controller_test.rb
typo-4.0.2 test/functional/theme_controller_test.rb
typo-4.0.1 test/functional/theme_controller_test.rb
typo-4.0.3 test/functional/theme_controller_test.rb