Sha256: e793ad849819213afcf41976d536fda7962a8e275947cb143bc4bee02d317b3d

Contents?: true

Size: 1.2 KB

Versions: 34

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe FbGraph::ReachEstimate, '.new' do
  let(:attributes) {
    {
      :users => 5503300,
      :bid_estimations => [
        {
          :location => 3,
          :cpc_min => 27,
          :cpc_median => 37,
          :cpc_max => 48,
          :cpm_min => 8,
          :cpm_median => 11,
          :cpm_max => 14
        }
      ],
      :imp_estimates => []
    }
  }

  let(:attributes_through_ad_group) {
    {
      :data => attributes
    }
  }
  it 'should setup all supported attributes' do
    estimate = FbGraph::ReachEstimate.new(attributes)
    estimate.users.should == 5503300
    estimate.cpc_min.should == 27
    estimate.cpc_median.should == 37
    estimate.cpc_max.should == 48
    estimate.cpm_min.should == 8
    estimate.cpm_median.should == 11
    estimate.cpm_max.should == 14
  end

  it 'should setup all supported attributes through AdGroup' do
    estimate = FbGraph::ReachEstimate.new(attributes_through_ad_group)
    estimate.users.should == 5503300
    estimate.cpc_min.should == 27
    estimate.cpc_median.should == 37
    estimate.cpc_max.should == 48
    estimate.cpm_min.should == 8
    estimate.cpm_median.should == 11
    estimate.cpm_max.should == 14
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.16 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.15 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.14 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.13 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.12 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.11 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.10 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.9 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.8 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.7 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.6 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.5 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.4 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.3 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.2 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.1 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.7.0 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.6.7 spec/fb_graph/reach_estimate_spec.rb
fb_graph-2.6.6 spec/fb_graph/reach_estimate_spec.rb