Sha256: 4fffc36d803f3f4c8d8c86bd66b98ceac67d6f5e3730c5a2d4ea25e7306c9e2b

Contents?: true

Size: 1.5 KB

Versions: 55

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'

describe FbGraph::AdAccount, '.new' do
  it 'should setup all supported attributes' do
    attributes = {
      :id => 'act_12345566',
      :account_id => 12345566,
      :name => 'Test Ad Account',
      :account_status => 1,
      :daily_spend_limit => 20000,
      :currency => "USD",
      :timezone_id => 1,
      :timezone_name => "America/Los_Angeles"
    }
    ad_account = FbGraph::AdAccount.new(attributes.delete(:id), attributes)
    ad_account.identifier.should == "act_12345566"
    ad_account.account_id.should == 12345566
    ad_account.name.should == "Test Ad Account"
    ad_account.account_status.should == 1
    ad_account.daily_spend_limit.should == 20000
    ad_account.currency.should == "USD"
    ad_account.timezone_id.should == 1
    ad_account.timezone_name.should == "America/Los_Angeles"
  end
end


describe FbGraph::AdAccount, '.fetch' do
  it 'should get the ad account' do
    mock_graph :get, 'act_12345566', 'ad_accounts/test_ad_account', :access_token => 'access_token' do
      ad_account = FbGraph::AdAccount.fetch('act_12345566', :access_token => 'access_token')

      ad_account.identifier.should == "act_12345566"
      ad_account.account_id.should == 12345566
      ad_account.name.should == "Test Ad Account"
      ad_account.account_status.should == 1
      ad_account.daily_spend_limit.should == 20000
      ad_account.currency.should == "USD"
      ad_account.timezone_id.should == 1
      ad_account.timezone_name.should == "America/Los_Angeles"
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
fb_graph-2.5.6 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.5 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.4 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.3 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.2 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.1 spec/fb_graph/ad_account_spec.rb
fb_graph-2.5.0 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.20 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.19 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.18 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.17 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.16 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.15 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.14 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.13 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.12 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.11 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.10 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.9 spec/fb_graph/ad_account_spec.rb
fb_graph-2.4.8 spec/fb_graph/ad_account_spec.rb