Sha256: 940afd33eb3da080c379de20b49d4b35c0f792b33af63445911107bcd34ddeb0

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe ThemeController do
  integrate_views

  it "test_stylesheets" do
    get :stylesheets, :filename => "style.css"
    assert_response :success
    assert_equal "text/css", @response.content_type
    assert_equal "utf-8", @response.charset
    assert_equal "inline; filename=\"style.css\"", @response.headers['Content-Disposition']
  end

  it "test_images" do
    get :images, :filename => "bg_white.png"
    assert_response :success
    assert_equal "image/png", @response.content_type
    assert_equal "inline; filename=\"bg_white.png\"", @response.headers['Content-Disposition']
  end

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

  it "test_view_theming" do
    get :static_view_test
    assert_response :success

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typo-5.4.4 spec/controllers/theme_controller_spec.rb
typo-5.4.3 spec/controllers/theme_controller_spec.rb
typo-5.4.2 spec/controllers/theme_controller_spec.rb
typo-5.4.1 spec/controllers/theme_controller_spec.rb
typo-5.4 spec/controllers/theme_controller_spec.rb