Sha256: abf7c44091c60dde893c91743146b6b9f9965c3d205dc15e9c16880dd88a23c6

Contents?: true

Size: 1.03 KB

Versions: 34

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe FbGraph2::Edge::Offers do
  context 'included in Page' do
    let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') }

    describe '#offers' do
      it 'should return an Array of FbGraph2::Offer' do
        offers = mock_graph :get, 'page_id/offers', 'page/offers', access_token: 'page_token' do
          page.offers
        end
        offers.should be_instance_of FbGraph2::Edge
        offers.should_not be_blank
        offers.each do |offer|
          offer.should be_instance_of FbGraph2::Offer
        end
      end
    end

    describe '#offer!' do
      it 'should return FbGraph2::Offer' do
        offer = mock_graph :post, 'page_id/offers', 'success_with_id', access_token: 'page_token', params: {
          title: 'Foobar',
          expiration_time: 10.days.from_now.to_s
        } do
          page.offer!(
            title: 'Foobar',
            expiration_time: 10.days.from_now
          )
        end
        offer.should be_instance_of FbGraph2::Offer
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
fb_graph2-1.3.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-1.2.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-1.1.1 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-1.1.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-1.0.1 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-1.0.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.9.1 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.9.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.8.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.9 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.8 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.7 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.6 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.5 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.4 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.3 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.2 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.1 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.7.0 spec/fb_graph2/edge/offers_spec.rb
fb_graph2-0.6.2 spec/fb_graph2/edge/offers_spec.rb