Sha256: f2f1a6f9a73b960c5615c4668042a1c2c6d69a6462b27a957794771a7529fb31

Contents?: true

Size: 1.54 KB

Versions: 26

Compression:

Stored size: 1.54 KB

Contents

# encoding: utf-8

require 'helper'

class TestChanges < MiniTest::Test

  def test_scores
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 1
    game2.score1p  = 5
    game2.score2p  = 3

    game_attribs = {
      score1: 1,
      score2: 2,
      score1et: nil,
      score2et: nil,
      score1p:  nil,
      score2p:  nil
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end
  
  def test_play_at
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2
    game1.play_at = DateTime.new( 2012, 11, 5 )

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 2
    game2.play_at = DateTime.new( 2012, 12, 24 )

    game_attribs = {
      score1:  1,
      score2:  2,
      play_at: DateTime.new( 2012, 11, 5 )
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end

  def test_group_id
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2
    game1.group_id = 1

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 2
    game2.group_id = 2

    game_attribs = {
      score1:  1,
      score2:  2,
      group_id: 1
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end

  
end # class TestChanges

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
sportdb-models-1.18.0 test/test_changes.rb
sportdb-models-1.17.0 test/test_changes.rb
sportdb-models-1.16.2 test/test_changes.rb
sportdb-models-1.16.1 test/test_changes.rb
sportdb-models-1.16.0 test/test_changes.rb
sportdb-models-1.15.2 test/test_changes.rb
sportdb-models-1.15.1 test/test_changes.rb
sportdb-models-1.15.0 test/test_changes.rb
sportdb-models-1.14.2 test/test_changes.rb
sportdb-models-1.14.1 test/test_changes.rb
sportdb-models-1.14.0 test/test_changes.rb
sportdb-models-1.13.0 test/test_changes.rb
sportdb-models-1.12.0 test/test_changes.rb
sportdb-models-1.11.2 test/test_changes.rb
sportdb-models-1.11.1 test/test_changes.rb
sportdb-models-1.11.0 test/test_changes.rb
sportdb-models-1.10.1 test/test_changes.rb
sportdb-models-1.10.0 test/test_changes.rb
sportdb-1.9.16 test/test_changes.rb
sportdb-1.9.15 test/test_changes.rb