Created
April 9, 2010 02:23
-
-
Save dansteen/360810 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'validators' | |
class Call < ActiveRecord::Base | |
belongs_to :clear_unit, :class_name=>"Member" | |
belongs_to :call_dispatcher | |
belongs_to :category, :class_name=>"CallCategory" | |
has_many :patients | |
has_many :responses | |
has_many :recordings | |
has_many :city_responders | |
has_many :members, :through=>:responses | |
validates_presence_of :address, :city, :state, :zip | |
validates_as_state :state | |
validates_length_of :zip, :is=>8 | |
... | |
and my test script is: | |
require 'test_helper' | |
class CallTest < ActiveSupport::TestCase | |
fixtures :calls | |
# Ensure that the address information is present | |
test "address_present" do | |
fall=Call.new | |
fall.zip="21215" | |
p fall.zip | |
assert fall.save! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment