Sha256: 3f9aaa2212a8ccd9a46f7091dc9f97199b1789dfbe39300d56a6e5569e638019

Contents?: true

Size: 1.21 KB

Versions: 56

Compression:

Stored size: 1.21 KB

Contents

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

class Config::UpdateTest < Test::Unit::TestCase
  def setup
    @config = ActiveScaffold::Config::Core.new :model_stub
  end
  
  def test__params_for_columns__returns_all_params
    @config._load_action_columns
    @config.columns[:a].params.add :keep_a, :a_temp
    assert @config.columns[:a].params.include?(:keep_a)
    assert @config.columns[:a].params.include?(:a_temp)
  end
  
  def test_default_options
    assert !@config.update.persistent
    assert !@config.update.nested_links
    assert_equal 'Update ModelStub', @config.update.label
  end
  
  def test_persistent
    @config.update.persistent = true
    assert @config.update.persistent
  end
  
  def test_nested_links
    @config.update.nested_links = true
    assert @config.update.nested_links
  end
  
  def test_label
    label = 'update new monkeys'
    @config.update.label = label
    assert_equal label, @config.update.label
    I18n.backend.store_translations :en, :active_scaffold => {:change_model => 'Change %{model}'}
    @config.update.label = :change_model
    assert_equal 'Change ModelStub', @config.update.label
    assert_equal 'Change record', @config.update.label('record')
  end
end

Version data entries

56 entries across 56 versions & 3 rubygems

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