Sha256: 8143bea342b96c327b5f4cc9b7a8d0845834d64087f66391e5ff66a87dec7be5

Contents?: true

Size: 972 Bytes

Versions: 23

Compression:

Stored size: 972 Bytes

Contents

require '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 = MultiJson.load(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

23 entries across 23 versions & 1 rubygems

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