Sha256: 55512210baac6fb928c4ba6dca409eae8d97e61ab4565b94f851101a9371b7eb

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 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.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.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.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

4 entries across 4 versions & 1 rubygems

Version Path
eucalyptus-0.3.3 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.3.2 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.3.1 spec/eucalyptus/campaign_spec.rb
eucalyptus-0.3.0 spec/eucalyptus/campaign_spec.rb