theme_controller_spec.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:1k
- 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