Sha256: 7a4ffbf75484e3a6c745c3a035b7dafc276561656fb71ccdcb7f3e9cf1fb0aa5

Contents?: true

Size: 968 Bytes

Versions: 83

Compression:

Stored size: 968 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 = 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

83 entries across 83 versions & 1 rubygems

Version Path
fb_graph-2.2.0.beta spec/fb_graph/targeting_spec.rb
fb_graph-2.2.0.alpha2 spec/fb_graph/targeting_spec.rb
fb_graph-2.2.0.alpha spec/fb_graph/targeting_spec.rb
fb_graph-2.1.13 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.12 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.11 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.10 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.9 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.8 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.7 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.6 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.5 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.4 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.3 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.2 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.1 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.0 spec/fb_graph/targeting_spec.rb
fb_graph-2.1.0.alpha spec/fb_graph/targeting_spec.rb
fb_graph-2.0.2 spec/fb_graph/targeting_spec.rb
fb_graph-2.0.1 spec/fb_graph/targeting_spec.rb