Sha256: 56c6513f25967d3aacfd10c482299d628041e814a17889e9f574ad440724605e

Contents?: true

Size: 1.13 KB

Versions: 65

Compression:

Stored size: 1.13 KB

Contents

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

class Config::ShowTest < Test::Unit::TestCase
  def setup
    @config = ActiveScaffold::Config::Core.new :model_stub
    @default_link = @config.show.link
  end
  
  def teardown
    @config.show.link = @default_link
  end
  
  def test_default_options
    assert_equal 'Show Modelstub', @config.show.label
  end

  def test_link_defaults
    link = @config.show.link
    assert !link.page?
    assert !link.popup?
    assert !link.confirm?
    assert_equal "show", link.action
    assert_equal "Show", link.label
    assert link.inline?
    blank = {}
    assert_equal blank, link.html_options
    assert_equal :get, link.method
    assert_equal :member, link.type
    assert_equal :read, link.crud_type
    assert_equal :show_authorized?, link.security_method
  end
  
  def test_setting_link
    @config.show.link = ActiveScaffold::DataStructures::ActionLink.new('update', :label => 'Monkeys')
    assert_not_equal(@default_link, @config.show.link)
  end
  
  def test_label
    label = 'create new monkeys'
    @config.show.label = label
    assert_equal label, @config.show.label
  end
end

Version data entries

65 entries across 65 versions & 4 rubygems

Version Path
active_scaffold_vho-4.0.0 test/config/show_test.rb
active_scaffold_vho-3.2.14 test/config/show_test.rb
active_scaffold_vho-3.2.13 test/config/show_test.rb
active_scaffold_vho-3.2.12 test/config/show_test.rb
active_scaffold_vho-3.2.11 test/config/show_test.rb
active_scaffold_vho-3.2.10 test/config/show_test.rb
active_scaffold_vho-3.2.9 test/config/show_test.rb
active_scaffold_vho-3.2.8 test/config/show_test.rb
active_scaffold_vho-3.2.7 test/config/show_test.rb
active_scaffold_vho-3.2.6 test/config/show_test.rb
active_scaffold_vho-3.2.5 test/config/show_test.rb
active_scaffold_vho-3.2.4 test/config/show_test.rb
active_scaffold_vho-3.2.3 test/config/show_test.rb
active_scaffold_vho-3.2.2 test/config/show_test.rb
active_scaffold_vho-3.2.1 test/config/show_test.rb
active_scaffold_vho-3.2.0 test/config/show_test.rb
active_scaffold_vho-3.0.31 test/config/show_test.rb
active_scaffold_vho-3.1.8 test/config/show_test.rb
active_scaffold_vho-3.0.30 test/config/show_test.rb
active_scaffold_vho-3.0.29 test/config/show_test.rb