Sha256: 928d41cca1e91584bcf4d46fc8bf77e873d3fd68ae99cc7373a53c8072450891

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

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

class TestConditionBase < Test::Unit::TestCase
  fixtures :accounts, :users, :orders
  
  def setup
    setup_db
    load_fixtures
  end
  
  def teardown
    teardown_db
  end
  
  def test_condition_name
    assert_equal "equals", Searchgasm::Condition::Equals.condition_name
    assert_equal "keywords", Searchgasm::Condition::Keywords.condition_name
    assert_equal "greater_than_or_equal_to", Searchgasm::Condition::GreaterThanOrEqualTo.condition_name
  end
  
  def test_string_column
    
  end
  
  def test_comparable_column
    
  end
  
  def test_initialize
    condition = Searchgasm::Condition::Keywords.new(Account, Account.columns_hash["name"])
    assert_equal condition.klass, Account
    assert_equal condition.column, Account.columns_hash["name"]
    
    condition = Searchgasm::Condition::GreaterThan.new(Account, "id")
    assert_equal condition.column, Account.columns_hash["id"]
  end
  
  def test_ignore_blanks?
    condition = Searchgasm::Condition::Equals.new(Account, Account.columns_hash["id"])
    assert !condition.class.ignore_blanks?
    
    condition = Searchgasm::Condition::Keywords.new(Account, Account.columns_hash["name"])
    assert condition.class.ignore_blanks?
  end
  
  def test_value
    
  end
  
  def test_method_creation_in_scope
    # test ot make sure methods are not created across the board for all models
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
searchgasm-1.1.3 test/test_condition_base.rb