Sha256: 380646f07f378e1d0ac45235fc803f86cf750682bbb756f0346f60725897b16d

Contents?: true

Size: 1.27 KB

Versions: 14

Compression:

Stored size: 1.27 KB

Contents

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

describe Eucalyptus::Campaign do
  before do
    Eucalyptus.configure do |config|
      config.access_token = ENV["ACCESS_TOKEN"]
    end
  end

  let(:campaign) { Eucalyptus::Campaign.all.last }

  describe '#insights' do
    it 'returns an array of insights for the account' do
      VCR.use_cassette("campaign_insights") do
        expect(campaign.insights).to be_a Array
        expect(campaign.insights.first).to be_a Eucalyptus::Insight
      end
    end
  end

  describe '#ads' do
    it 'returns a collection of Ad objects which belong to the campaign' do
      VCR.use_cassette("campaign_ads") do
        expect(campaign.ads).to be_a Array
        expect(campaign.ads.first).to be_a Eucalyptus::Ad
      end
    end
  end

  describe '#ad_sets' do
    it 'returns a collection of Ad objects which belong to the campaign' do
      VCR.use_cassette("campaign_ad_sets") do
        expect(campaign.ad_sets).to be_a Array
        expect(campaign.ad_sets.first).to be_a Eucalyptus::AdSet
      end
    end
  end

  describe 'returning known fields' do
    it 'returns an object which responds to available fields' do
      VCR.use_cassette("campaign") do
        expect(campaign).to respond_to :name
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
eucalyptus-0.2.13 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.12 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.11 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.10 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.9 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.8 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.7 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.6 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.5 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.4 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.3 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.2 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.1 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.2.0 spec/eucalyptus/campaign_spec.rb