Sha256: d30013fe979313a724ae14020bcbd1cce529da69c526d20b80d845ae010d2d25

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

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

describe Eucalyptus::Ad do

  let(:ad) { Eucalyptus::Ad.all.last }

  describe '#find' do
    it 'retuns an ad' do
      VCR.use_cassette("ad") do
        ad = Eucalyptus::Ad.all.last
        Eucalyptus::Ad.find(ad.id)
      end
    end
  end

  describe '#insights' do
    it 'returns an array of insights for the account' do
      VCR.use_cassette("ad_set_insights") do
        active_ad = Eucalyptus::Ad.all.find{|ad| ad.adgroup_status == "ACTIVE"}
        expect(active_ad.insights.first).to be_a Eucalyptus::Insight
      end
    end
  end

  describe '#ad_set' do
    it 'returns the parent ad_set for this ad' do
      VCR.use_cassette("ad_adset") do
        expect(ad.ad_set).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("ad") do
        expect(ad).to respond_to :name
        expect(ad).to respond_to :adgroup_status
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eucalyptus-1.2.4 spec/eucalyptus/ad_spec.rb
eucalyptus-1.2.3 spec/eucalyptus/ad_spec.rb
eucalyptus-1.2.2 spec/eucalyptus/ad_spec.rb
eucalyptus-1.2.1 spec/eucalyptus/ad_spec.rb
eucalyptus-1.2.0 spec/eucalyptus/ad_spec.rb
eucalyptus-1.1.0 spec/eucalyptus/ad_spec.rb
eucalyptus-1.0.0 spec/eucalyptus/ad_spec.rb