Sha256: 24d36eb4d02a8b97c822c6608017a3e0d1ffeec25f1613ec4719315e1b35e15b

Contents?: true

Size: 1 KB

Versions: 2

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe "QBFC::Customer" do

  before(:each) do 
    @integration = QBFC::Integration::reader
    @sess = @integration.session
    @bob = @sess.customers.find_by_name("Bob Customer")
    @sue = @sess.customers.find_by_name("Sue Customer")
  end
  
  after(:each) do 
    @integration.close
  end

  it "should get name" do
    @bob.name.should == "Bob Customer"
    @sue.name.should == "Sue Customer"

    @bob.full_name.should == "Bob Customer"
    @sue.full_name.should == "Sue Customer"
  end
  
end

describe "QBFC::Customer(setters)" do
    
  before(:each) do 
    @integration = QBFC::Integration.new
    @sess = @integration.session
    @bob = @sess.customers.find_by_name("Bob Customer")
  end
  
  after(:each) do 
    @integration.close
  end
  
  it "should set name" do
    new_name = "New Customer"
    @bob.name = new_name
    @bob.name.should == new_name
    @bob.save
    
    @sess.customers.find(new_name).name.should == new_name
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
jm81-qbfc-0.3.0 spec/integration/customer_spec.rb
qbfc-0.3.0 spec/integration/customer_spec.rb