Sha256: e2c36e41afa616918d6f6b272d9437694ae5eb310e987ebc4adcc3038195d821

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 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 = 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

1 entries across 1 versions & 1 rubygems

Version Path
presenting-1.0.0 test/search_test.rb