Sha256: eb5d4b7a6d50a6b664d67126ccf90898aa03d8495158709ed74e2636939fd4e3

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'

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

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

    [
      :attire,
      :culinary_team,
      :general_manager,
      :link,
      :phone,
      :price_range,
      :public_transit
    ].each do |key|
      its(key) { should be_instance_of String }
    end

    [
      :parking,
      :payment_options,
      :restaurant_services,
      :restaurant_specialties
    ].each do |key|
      its(key) { should be_instance_of Array }
      describe key do
        it 'should be an Array of Symbol' do
          page.send(key).should_not be_blank
          page.send(key).all? do |value|
            value.should be_instance_of Symbol
          end
        end
      end
    end

    its(:hours) { should be_instance_of Hash }
    its(:hours) do
      should == {
        :mon => [
          {:open  => Time.parse('Thu Jan 01 09:00:00 UTC 1970')},
          {:close => Time.parse('Thu Jan 01 17:00:00 UTC 1970')}
        ]
      }
    end

    its(:location) do
      should == FbGraph::Venue.new(
        :street => '新田辺',
        :city => 'Kyoto',
        :country => 'Japan',
        :zip => '513001'
      )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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