Sha256: af66b7dca9f0e35c929a3d49ac17e465c36cc8ca707183592907519d434d7578
Contents?: true
Size: 1.39 KB
Versions: 4
Compression:
Stored size: 1.39 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ActsAsIcontact::ContactHistory do before(:each) do @contact = ActsAsIcontact::Contact.find(333333) @this = @contact.history.first end it "knows its contact" do @this.contact.email.should == "john@example.org" end it "cannot be altered" do lambda{@this.actor = 333333}.should raise_error(ActsAsIcontact::ReadOnlyError, "Contact History is read-only!") end it "cannot be saved" do lambda{@this.save}.should raise_error(ActsAsIcontact::ReadOnlyError, "Contact History is read-only!") end it "does not allow .find" do lambda{ActsAsIcontact::ContactHistory.find(:all)}.should raise_error(ActsAsIcontact::QueryError, "Contact History must be obtained using the Contact#history method.") end it "does not allow .first" do lambda{ActsAsIcontact::ContactHistory.first}.should raise_error(ActsAsIcontact::QueryError, "Contact History must be obtained using the Contact#history method.") end it "does not allow .all" do lambda{ActsAsIcontact::ContactHistory.all}.should raise_error(ActsAsIcontact::QueryError, "Contact History must be obtained using the Contact#history method.") end it "requires a contactId" do lambda{ActsAsIcontact::ContactHistory.new(contact: nil)}.should raise_error(ActsAsIcontact::ValidationError, "Contact History requires a Contact") end end
Version data entries
4 entries across 4 versions & 2 rubygems