Sha256: bf686c3a7ff7539e480013d6491e370ba8040d181babb7ea153fdeaa46b74927

Contents?: true

Size: 817 Bytes

Versions: 5

Compression:

Stored size: 817 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'

class ActionControllerTest < ActionController::TestCase
  ::ActionController::Routing::Routes.draw do |map|
    map.connect "/:controller/:action/:id"
  end

  def setup
    @controller = HelloWorldController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  def test_rendering_component_from_controller
    get :say_it, :string => "onomatopoeia"
    assert_equal "onomatopoeia", @response.body
  end

  def test_standard_component_options
    HelloWorldController.any_instance.stubs(:standard_component_options).returns(:user => "snuffalumpagus")
    HelloWorldComponent.any_instance.expects(:say_it).with("wawoowifnik", :user => "snuffalumpagus")
    get :say_it, :string => "wawoowifnik"
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
langalex-components-0.0.1 test/action_controller_test.rb
langalex-components-0.0.2 test/action_controller_test.rb
langalex-components-0.0.3 test/action_controller_test.rb
langalex-components-0.0.4 test/action_controller_test.rb
components-0.0.5 test/action_controller_test.rb