Sha256: b132e26a4b14dd5ab256ee093ccb665020cbecb53ddd9b13b68df46365bb56e4

Contents?: true

Size: 1.31 KB

Versions: 17

Compression:

Stored size: 1.31 KB

Contents

require 'test_helper'

module Config
  class UpdateTest < MiniTest::Test
    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
      refute @config.update.persistent
      refute @config.update.nested_links
      assert_equal 'Model stub', @config.update.label
    end
    
    def test_persistent
      @config.update.persistent = true
      assert @config.update.persistent
    end
    
    def test_nested_links
      old, @config.update.nested_links = @config.update.nested_links, true
      assert @config.update.nested_links
      @config.update.nested_links = old
    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 Model stub', @config.update.label
      assert_equal 'Change record', @config.update.label('record')
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
active_scaffold-3.4.17 test/config/update_test.rb
active_scaffold-3.4.16 test/config/update_test.rb
active_scaffold-3.4.14 test/config/update_test.rb
active_scaffold-3.4.13 test/config/update_test.rb
active_scaffold-3.4.12 test/config/update_test.rb
active_scaffold-3.4.11 test/config/update_test.rb
active_scaffold-3.4.10 test/config/update_test.rb
active_scaffold-3.4.9 test/config/update_test.rb
active_scaffold-3.4.8 test/config/update_test.rb
active_scaffold-3.4.7 test/config/update_test.rb
active_scaffold-3.4.5 test/config/update_test.rb
active_scaffold-3.4.4 test/config/update_test.rb
active_scaffold-3.4.3 test/config/update_test.rb
active_scaffold-3.4.2 test/config/update_test.rb
active_scaffold-3.4.1 test/config/update_test.rb
active_scaffold-3.4.0.1 test/config/update_test.rb
active_scaffold-3.4.0 test/config/update_test.rb