Sha256: 705abaef1af652c4f20a844dfc420387d12f13c00153910da0d14f19efe6119d

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe ActsAsIcontact, "account_id" do
  it "returns the ID from the first client folder returned by iContact" do
    ActsAsIcontact.clientfolder_id.should == 222222
  end
  
  it "can be set by the user" do
    ActsAsIcontact.clientfolder_id = 456
    ActsAsIcontact.clientfolder_id.should == 456
  end
  
  after(:each) do
    ActsAsIcontact.clientfolder_id = nil
  end
end


describe ActsAsIcontact, "clientfolder method" do
  it "returns a RestClient resource" do
    ActsAsIcontact.clientfolder.should be_a_kind_of(RestClient::Resource)
  end
    
  it "can be cleared with the reset_account! method" do
    ActsAsIcontact.reset_clientfolder!
    ActsAsIcontact.instance_variable_get(:@clientfolder).should be_nil
  end
  
  after(:each) do
    ActsAsIcontact.reset_clientfolder!
  end
end

describe ActsAsIcontact::ClientFolder do
  it "can return all clients for the given account" do
    ActsAsIcontact::ClientFolder.all.count.should == 1
  end
  
  it "can return the first client" do
    ActsAsIcontact::ClientFolder.first.should be_a_kind_of(ActsAsIcontact::ClientFolder)
  end
    
  it "knows its properties" do
    c = ActsAsIcontact::ClientFolder.first
    c.emailRecipient.should == "bob@example.org"
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
SFEley-acts_as_icontact-0.4.2 spec/resources/clientfolder_spec.rb
SFEley-acts_as_icontact-0.4.3 spec/resources/clientfolder_spec.rb
acts_as_icontact-0.4.3 spec/resources/clientfolder_spec.rb
acts_as_icontact-0.4.2 spec/resources/clientfolder_spec.rb