Sha256: 709b51b1b946d9329e905e703dd50fc47d87a51689a5250fb093f099c48eb912

Contents?: true

Size: 967 Bytes

Versions: 9

Compression:

Stored size: 967 Bytes

Contents

require 'test_helper'

module Config
  class DeleteTest < Minitest::Test
    def setup
      @config = ActiveScaffold::Config::Core.new :model_stub
      @default_link = @config.delete.link
    end

    def teardown
      @config.delete.link = @default_link
    end

    def test_link_defaults
      link = @config.delete.link
      refute link.page?
      refute link.popup?
      assert link.confirm?
      assert_equal 'destroy', link.action
      assert_equal 'Delete', link.label
      assert link.inline?
      blank = {}
      assert_equal blank, link.html_options
      assert_equal :delete, link.method
      assert_equal :member, link.type
      assert_equal :delete, link.crud_type
      assert_equal :delete_authorized?, link.security_method
    end

    def test_setting_link
      @config.delete.link = ActiveScaffold::DataStructures::ActionLink.new('update', :label => 'Monkeys')
      refute_equal @default_link, @config.delete.link
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
active_scaffold-3.7.11 test/config/delete_test.rb
active_scaffold-3.7.10 test/config/delete_test.rb
active_scaffold-3.7.8 test/config/delete_test.rb
active_scaffold-3.7.7 test/config/delete_test.rb
active_scaffold-3.7.6 test/config/delete_test.rb
active_scaffold-3.7.5 test/config/delete_test.rb
active_scaffold-3.7.2 test/config/delete_test.rb
active_scaffold-3.7.1 test/config/delete_test.rb
active_scaffold-3.7.0 test/config/delete_test.rb