Sha256: e2bd6291526ab43837021c83515af647fa7e28bf6f151ef3e0a08b9e883f1885

Contents?: true

Size: 1.43 KB

Versions: 56

Compression:

Stored size: 1.43 KB

Contents

require File.join(File.dirname(__FILE__), '../test_helper.rb')

class Config::FieldSearchTest < Test::Unit::TestCase
  def setup
    @config = ActiveScaffold::Config::Core.new :model_stub
    @config.actions.swap :search, :field_search
    @default_link = @config.field_search.link
  end
  
  def teardown
    @config.field_search.link = @default_link
  end
  
  def test_default_options
    assert_equal :full, @config.field_search.text_search
  end
  
  def test_text_search
    @config.field_search.text_search = :start
    assert_equal :start, @config.field_search.text_search
    @config.field_search.text_search = :end
    assert_equal :end, @config.field_search.text_search
    @config.field_search.text_search = false
    assert !@config.field_search.text_search
  end

  def test_link_defaults
    link = @config.field_search.link
    assert !link.page?
    assert !link.popup?
    assert !link.confirm?
    assert_equal "show_search", link.action
    assert_equal "Search", link.label
    assert link.inline?
    blank = {}
    assert_equal blank, link.html_options
    assert_equal :get, link.method
    assert_equal :collection, link.type
    assert_equal :read, link.crud_type
    assert_equal :search_authorized?, link.security_method
  end
  
  def test_setting_link
    @config.field_search.link = ActiveScaffold::DataStructures::ActionLink.new('update', :label => 'Monkeys')
    assert_not_equal(@default_link, @config.field_search.link)
  end
end

Version data entries

56 entries across 56 versions & 3 rubygems

Version Path
active_scaffold-sequel-0.8.0 test/config/field_search_test.rb
active_scaffold-sequel-0.7.1 test/config/field_search_test.rb
active_scaffold-sequel-0.7.0 test/config/field_search_test.rb
active_scaffold-sequel-0.6.2 test/config/field_search_test.rb
active_scaffold-sequel-0.6.1 test/config/field_search_test.rb
active_scaffold-sequel-0.6.0 test/config/field_search_test.rb
active_scaffold-3.3.2 test/config/field_search_test.rb
active_scaffold-3.3.1 test/config/field_search_test.rb
active_scaffold-3.3.0 test/config/field_search_test.rb
active_scaffold-3.2.20 test/config/field_search_test.rb
brisk-bills-0.8.2 vendor/plugins/active_scaffold/test/config/field_search_test.rb
active_scaffold-3.3.0.rc3 test/config/field_search_test.rb
active_scaffold-3.3.0.rc2 test/config/field_search_test.rb
brisk-bills-0.8.1 vendor/plugins/active_scaffold/test/config/field_search_test.rb
active_scaffold-3.2.19 test/config/field_search_test.rb
active_scaffold-3.2.18 test/config/field_search_test.rb
active_scaffold-3.3.0.rc test/config/field_search_test.rb
active_scaffold-3.2.17 test/config/field_search_test.rb
active_scaffold-3.2.16 test/config/field_search_test.rb
active_scaffold-3.2.15 test/config/field_search_test.rb