Sha256: 04af4b5b4b15aa8e79453d7bbfed63db3f5b235595178e1cf04de6e9080e459e

Contents?: true

Size: 1006 Bytes

Versions: 32

Compression:

Stored size: 1006 Bytes

Contents

require File.join(File.dirname(__FILE__), '../spec_helper')

describe FbGraph::Targeting, '.new' do
  it 'should setup all supported attributes' do
    attributes = {
      :country => 'jp',
      :city    => 'Tokyo',
      :region  => 'Tokyo',
      :locale  => 9
    }
    targeting = FbGraph::Targeting.new(attributes)
    targeting.country.should == 'jp'
    targeting.city.should    == 'Tokyo'
    targeting.region.should  == 'Tokyo'
    targeting.locale.should  == 9
  end
end

describe FbGraph::Targeting, '.to_json' do
  it 'should return JSON object' do
    attributes = {
      :country => 'jp',
      :city    => 'Tokyo',
      :locale  => 9,
      :region  => 'Tokyo'
    }
    targeting = FbGraph::Targeting.new(attributes)
    hash = JSON.parse(targeting.to_json).with_indifferent_access
    hash[:country].should == attributes[:country]
    hash[:city].should    == attributes[:city]
    hash[:locale].should  == attributes[:locale]
    hash[:region].should  == attributes[:region]
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/targeting_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.9 spec/fb_graph/targeting_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/targeting_spec.rb
fb_graph-1.6.8 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.7 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.5 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.4 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.3 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.2 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.1 spec/fb_graph/targeting_spec.rb
fb_graph-1.6.0 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.5 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.4 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.3 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.2 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.1 spec/fb_graph/targeting_spec.rb
fb_graph-1.5.0 spec/fb_graph/targeting_spec.rb
fb_graph-1.4.1 spec/fb_graph/targeting_spec.rb
fb_graph-1.4.0 spec/fb_graph/targeting_spec.rb