Sha256: 290be121fa6e275d82ef251e2f2c72fbe4e13ebeac9f292b8c841a7e3851c516

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

describe Individual do
  it "can be instantiated" do
    Individual.new.should be_an_instance_of(Individual)
  end

  it "can be saved successfully" do
    Individual.create.should be_persisted
  end
  
  it "creates party" do
    individual = Individual.create(:current_first_name => 'Dummy', :current_last_name => 'Person')
    individual.should be_an_instance_of(Individual)
    individual.party.should be_an_instance_of(Party) 
    individual.party.description.should == "Dummy Person"
    individual.party.business_party.should == individual
  end
  
  it "destroys party" do
    individual = Individual.create(:current_first_name => 'Dummy', :current_last_name => 'Person')
    individual.should be_an_instance_of(Individual)
    
    party = individual.party
    individual.party.should be_an_instance_of(Party) 
    individual.party.description.should == "Dummy Person"
    individual.party.business_party.should == individual
    
    individual.destroy
    Party.where("id = ?",party.id).count.should == 0
  end
  
  it "should have encrypted ssn" do
    individual = Individual.create(:current_first_name => 'Dummy', :current_last_name => 'Person')
    individual.social_security_number = "123212323"
    individual.encrypted_ssn.should_not == "123212323"
    individual.social_security_number.should == "123212323"
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
erp_base_erp_svcs-4.2.0 spec/models/individual_spec.rb
erp_base_erp_svcs-4.0.0 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.5 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.4 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.3 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.2 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.1 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.7 spec/models/individual_spec.rb
erp_base_erp_svcs-3.1.0 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.6 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.5 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.4 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.3 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.2 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.1 spec/models/individual_spec.rb
erp_base_erp_svcs-3.0.0 spec/models/individual_spec.rb