Sha256: e7c0f02a9612ad7c4b411cc86ec2621391638dae2424acb8a5a715317cc2d25f

Contents?: true

Size: 843 Bytes

Versions: 5

Compression:

Stored size: 843 Bytes

Contents

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

class SearchTest < Presenting::Test
  def setup
    @s = Presentation::Search.new
  end
  
  # there's no configuration yet
end

class SearchRenderTest < Presentation::RenderTest
  def setup
    @presentation = Presentation::Search.new
    @presentation.controller = ActionView::TestCase::TestController.new
    @presentation.controller.request.path = '/users'
  end
  
  def test_rendering_a_form_reuses_current_path
    assert_select 'form[action=/users?][method=get]'
  end
  
  def test_rendering_a_search_box
    assert_select 'form input[type=text][name=search]'
  end
  
  def test_rendering_a_search_box_with_a_existing_search
    @presentation.controller.params[:search] = 'foo'
    assert_select 'form input[type=text][name=search][value=foo]'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
presenting-3.0.0 test/search_test.rb
presenting-2.1.0 test/search_test.rb
presenting-2.0.3 test/search_test.rb
presenting-2.0.2 test/search_test.rb
presenting-2.0.1 test/search_test.rb