Sha256: 85bcac8ad2ab49f01a2e37b82de3e28940a9bcf5cae0d6ca7c461f27663d0f50

Contents?: true

Size: 1014 Bytes

Versions: 8

Compression:

Stored size: 1014 Bytes

Contents

require 'test_helper'

class ViewMethodsTest < ActionController::TestCase
  include Apotomo::TestCaseMethods::TestController
  
  context "A Rails controller view" do
    setup do
      @controller.instance_variable_set(:@mum, mouse_mock('mum', 'snuggle') {def snuggle; render; end})
      @controller.instance_eval do
        def widget
          use_widgets do |root|
            root << @mum
          end
          render :inline => "<%= render_widget 'mum' %>"
        end
      end
    end
    
    should "respond to render_widget" do
      get :widget
      assert_select "#mum>snuggle"
    end
    
    should "respond to url_for_event" do
      @controller.instance_eval do
        def widget
          use_widgets do |root|
            root << @mum
          end
          render :inline => "<%= url_for_event :footsteps, :source => 'mum' %>"
        end
      end
      
      get :widget
      assert_equal "/barn/render_event_response?source=mum&amp;type=footsteps", @response.body
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
apotomo-1.0.5 test/rails/view_methods_test.rb
apotomo-1.0.4 test/rails/view_methods_test.rb
apotomo-1.0.3 test/rails/view_methods_test.rb
apotomo-1.0.2 test/rails/view_methods_test.rb
apotomo-1.0.1 test/rails/view_methods_test.rb
apotomo-1.0.0 test/rails/view_methods_test.rb
apotomo-1.0.0.beta2 test/rails/view_methods_test.rb
apotomo-1.0.0.beta1 test/rails/view_methods_test.rb