Sha256: 5d24dc8582c67b94066932f57caf146b14d7bd4d4e9d24c7c4b35ef9303398f7

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

require 'spec_helper'

describe FbGraph::Page do
  context 'for product category' do
    before do
      fake_json(:get, 'product', 'pages/categories/product')
    end

    let(:page) { FbGraph::Page.new('product').fetch }
    subject { page }

    [
      :awards,
      :features,
      :link,
      :mission,
      :mpg,
      :picture,
      :products
    ].each do |key|
      its(key) { should be_instance_of String }
    end

    its(:built)        { should == 'Since 1980' }
    its(:founded)      { should == '1980' }
    its(:release_date) { should == Date.parse('Wed, 01 Oct 1980') }

    context 'when valid date format' do
      subject do
        FbGraph::Page.new('12345', :built => 'May 1980', :founded => 'Oct 1980')
      end
      its(:built)   { should == Date.parse('Thu, 01 May 1980') }
      its(:founded) { should == Date.parse('Wed, 01 Oct 1980') }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-1.7.1 spec/fb_graph/page/product_spec.rb