test/rails/controller_methods_test.rb in apotomo-0.1.2 vs test/rails/controller_methods_test.rb in apotomo-0.1.3

- old
+ new

@@ -1,6 +1,6 @@ -require File.join(File.dirname(__FILE__), *%w[.. test_helper]) +require 'test_helper' class ControllerMethodsTest < ActionController::TestCase context "A Rails controller" do setup do barn_controller! @@ -22,13 +22,13 @@ assert_kind_of Apotomo::RequestProcessor, @controller.apotomo_request_processor assert_equal 1, @controller.apotomo_request_processor.root.size end end - context "invoking #uses_widgets" do + context "invoking #has_widgets" do setup do - @controller.class.uses_widgets do |root| + @controller.class.has_widgets do |root| root << mouse_mock('mum') end end should "add the widgets to apotomo_root" do @@ -38,23 +38,23 @@ should "add the widgets only once in apotomo_root" do @controller.apotomo_root assert @controller.apotomo_root['mum'] end - should "allow multiple calls to uses_widgets" do - @controller.class.uses_widgets do |root| + should "allow multiple calls to has_widgets" do + @controller.class.has_widgets do |root| root << mouse_mock('kid') end assert @controller.apotomo_root['mum'] assert @controller.apotomo_root['kid'] end - should "inherit uses_widgets blocks to sub-controllers" do + should "inherit has_widgets blocks to sub-controllers" do berry = mouse_mock('berry') @sub_controller = Class.new(@controller.class) do - uses_widgets { |root| root << berry } + has_widgets { |root| root << berry } end.new @sub_controller.params = {} @sub_controller.session = {} assert @sub_controller.apotomo_root['mum'] @@ -201,6 +201,6 @@ assert_recognizes({ :controller => "apotomo", :action => "render_event_response", :type => "squeak" }, "/apotomo/render_event_response?type=squeak") end end -end \ No newline at end of file +end