Sha256: 9ebb43c5db8597a15765ccc27a35c57a7de01b8c0387c0252ae55bfe1c500940

Contents?: true

Size: 1001 Bytes

Versions: 10

Compression:

Stored size: 1001 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'
require 'clevic/table_model.rb'

# need to set up a test DB, and test data for this
class TestTableModel < Test::Unit::TestCase
  def setup
    @table_model = Clevic::TableModel.new( )
  end

  def teardown
  end

  should "be an empty shell" do
    assert true
  end

  should_eventually 'not have new record on empty' do
    # without auto_new
    (0...Passenger.count).each do |i|
      @table_model.delete_at 0
      @table_model.delete_at 0
      @table_model.delete_at 0
    end
    assert_equal 0, @table_model.size
  end

  should_eventually 'have new record on empty' do
    #with auto_new
    @table_model = @table_model.renew( :auto_new => true )
    assert !@table_model.options.has_key?( :auto_new ), "CacheTable should not have :auto_new in options"
    (0...Passenger.count).each do |i|
      @table_model.delete_at 0
      @table_model.delete_at 0
      @table_model.delete_at 0
    end

    assert_equal 1, @table_model.size
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clevic-0.14.6 test/test_table_model.rb
clevic-0.14.5 test/test_table_model.rb
clevic-0.14.4 test/test_table_model.rb
clevic-0.14.3 test/test_table_model.rb
clevic-0.14.2 test/test_table_model.rb
clevic-0.14.1 test/test_table_model.rb
clevic-0.14.0 test/test_table_model.rb
clevic-0.13.0.b12 test/test_table_model.rb
clevic-0.13.0.b11 test/test_table_model.rb
clevic-0.13.0.b10 test/test_table_model.rb