Sha256: af0220cce192bab32fbb44f96370e7c80245a313619f7e397d1e8c05ac298a53

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

require 'test_helper'

class EmployeeTest < ActiveSupport::TestCase
  fixtures :employees,:credentials

  def test_is_active  
    jsmith = Employee.create! :first_name => 'John', :last_name => 'Smith', :email_address => 'jsmith@test.com'
    
    base_employees = ["Chris DeRose", "Arian Amador", "Michael Bogle"]
    
    assert_equal base_employees+["John Smith"], Employee.find_active(:all).collect{|e| e.name}
    
    jsmith.is_active = false
    jsmith.save!
    
    assert_equal base_employees, Employee.find_active(:all).collect{|e| e.name}
    
    assert_equal base_employees, Employee.find_active(:all, :conditions => ['id > ?', 0]).collect{|e| e.name}
    
    assert_equal base_employees, Employee.find_active(:all, :conditions => 'id > 0').collect{|e| e.name}
    
    assert_equal base_employees, Employee.find_active(:all, :conditions => ['id > 0']).collect{|e| e.name}
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brisk-bills-0.8.2 test/unit/employee_test.rb
brisk-bills-0.8.1 test/unit/employee_test.rb