Sha256: 2dae7ab3742d72e8e0746dffb83e4b68542cdca29a75257ea4a6e22ab5e1234d

Contents?: true

Size: 1.79 KB

Versions: 100

Compression:

Stored size: 1.79 KB

Contents

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

class ActionLinkTest < Test::Unit::TestCase
  def setup
    @link = ActiveScaffold::DataStructures::ActionLink.new('foo')
  end

  def test_simple_attributes
    assert_equal 'foo', @link.action
    @link.action = 'bar'
    assert_equal 'bar', @link.action

    hash = {:a => :b}
    @link.parameters = hash
    assert_equal hash, @link.parameters

    @link.label = 'hello world'
    assert_equal 'hello world', @link.label

    assert !@link.confirm
    @link.confirm = true
    assert @link.confirm

    @link.label = 'Hello World'
    assert_equal 'hello_world_authorized?', @link.security_method
    @link.label = 'HelloWorld'
    assert_equal 'hello_world_authorized?', @link.security_method
    @link.security_method = 'blueberry_pie'
    assert_equal 'blueberry_pie', @link.security_method

    @link.type = :table
    assert_equal :table, @link.type
    @link.type = :record
    assert_equal :record, @link.type

    assert_equal :get, @link.method
    @link.method = :put
    assert_equal :put, @link.method
  end

  def test_position
    @link.position = true

    @link.type = :table
    assert_equal :top, @link.position

    @link.type = :record
    assert_equal :replace, @link.position

    @link.position = :before
    assert_equal :before, @link.position

    @link.position = false
    assert_equal false, @link.position
  end

  def test_presentation_style
    # default
    assert @link.inline?
    assert !@link.popup?
    assert !@link.page?

    @link.popup = true
    assert !@link.inline?
    assert @link.popup?
    assert !@link.page?

    @link.page = true
    assert !@link.inline?
    assert !@link.popup?
    assert @link.page?

    @link.inline = true
    assert @link.inline?
    assert !@link.popup?
    assert !@link.page?
  end
end

Version data entries

100 entries across 100 versions & 3 rubygems

Version Path
six-updater-web-0.24.15 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.14 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.13 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.12 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.11 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.10 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.9 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.8 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.7 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.6 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.5 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
brisk-bills-0.7.0 vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.4 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.3 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.2 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.1 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.24.0 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.23.7 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.23.6 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb
six-updater-web-0.23.5 lib/six-updater-web/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb