annotate vendor/plugins/engines/test/functional/view_helpers_test.rb @ 8:0c83d98252d9 yuya

* Add custom repo prefix and proper auth realm, remove auth cache (seems like an unwise feature), pass DB handle around, various other bits of tidying
author Chris Cannam
date Thu, 12 Aug 2010 15:31:37 +0100
parents 513646585e45
children
rev   line source
Chris@0 1 require File.dirname(__FILE__) + '/../test_helper'
Chris@0 2
Chris@0 3 class ViewHelpersTest < ActionController::TestCase
Chris@0 4 tests AssetsController
Chris@0 5
Chris@0 6 def setup
Chris@0 7 get :index
Chris@0 8 end
Chris@0 9
Chris@0 10 def test_plugin_javascript_helpers
Chris@0 11 base_selector = "script[type='text/javascript']"
Chris@0 12 js_dir = "/plugin_assets/test_assets/javascripts"
Chris@0 13 assert_select "#{base_selector}[src='#{js_dir}/file.1.js']"
Chris@0 14 assert_select "#{base_selector}[src='#{js_dir}/file2.js']"
Chris@0 15 end
Chris@0 16
Chris@0 17 def test_plugin_stylesheet_helpers
Chris@0 18 base_selector = "link[media='screen'][rel='stylesheet'][type='text/css']"
Chris@0 19 css_dir = "/plugin_assets/test_assets/stylesheets"
Chris@0 20 assert_select "#{base_selector}[href='#{css_dir}/file.1.css']"
Chris@0 21 assert_select "#{base_selector}[href='#{css_dir}/file2.css']"
Chris@0 22 end
Chris@0 23
Chris@0 24 def test_plugin_image_helpers
Chris@0 25 assert_select "img[src='/plugin_assets/test_assets/images/image.png'][alt='Image']"
Chris@0 26 end
Chris@0 27
Chris@0 28 def test_plugin_layouts
Chris@0 29 get :index
Chris@0 30 assert_select "div[id='assets_layout']"
Chris@0 31 end
Chris@0 32
Chris@0 33 def test_plugin_image_submit_helpers
Chris@0 34 assert_select "input[src='/plugin_assets/test_assets/images/image.png'][type='image']"
Chris@0 35 end
Chris@0 36
Chris@0 37 end