diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 14 | ||||
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 9 |
2 files changed, 17 insertions, 6 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index be59da9105..ce4b407c7d 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -14,6 +14,14 @@ module Fun end end +module Quiz + class QuestionsController < ActionController::Base + def new + render :partial => Quiz::Question.new("Namespaced Partial") + end + end +end + class TestController < ActionController::Base protect_from_forgery @@ -1251,6 +1259,12 @@ class RenderTest < ActionController::TestCase assert_template('fun/games/_form') end + def test_namespaced_object_partial + @controller = Quiz::QuestionsController.new + get :new + assert_equal "Namespaced Partial", @response.body + end + def test_partial_collection get :partial_collection assert_equal "Hello: davidHello: mary", @response.body diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index f11d1bba15..1135c55ff0 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -12,7 +12,6 @@ class SprocketsHelperTest < ActionView::TestCase super @controller = BasicController.new - @controller.stubs(:params).returns({}) @request = Class.new do def protocol() 'http://' end @@ -27,10 +26,8 @@ class SprocketsHelperTest < ActionView::TestCase @assets.paths << FIXTURES.join("sprockets/app/stylesheets") @assets.paths << FIXTURES.join("sprockets/app/images") - application = Object.new + application = Struct.new(:config, :assets).new(config, @assets) Rails.stubs(:application).returns(application) - application.stubs(:config).returns(config) - application.stubs(:assets).returns(@assets) @config = config @config.action_controller ||= ActiveSupport::InheritableOptions.new @config.perform_caching = true @@ -54,7 +51,7 @@ class SprocketsHelperTest < ActionView::TestCase assert_equal "/dir/audio", asset_path("/dir/audio") end - + test "asset_path with absolute urls" do assert_equal "http://www.example.com/video/play", asset_path("http://www.example.com/video/play") @@ -74,7 +71,7 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{http://assets-\d.example.com/assets/logo-[0-9a-f]+.png}, asset_path("logo.png") end - + test "With a proc asset host that returns no protocol the url should be protocol relative" do @controller.config.asset_host = Proc.new do |asset| "assets-999.example.com" |