Sha256: 804a5575d7259aa6cfbf394ad837672b09858d1482c6f42406a78e844f0d5829

Contents?: true

Size: 1.23 KB

Versions: 42

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Maybe do
  let(:event) do
    FbGraph::Event.new('smartday', :access_token => 'access_token')
  end

  describe '#maybe' do
    it 'should return maybe users as FbGraph::User' do
      mock_graph :get, 'smartday/maybe', 'events/maybe/smartday_private', :access_token => 'access_token' do
        event.maybe.each do |user|
          user.should be_instance_of(FbGraph::User)
        end
      end
    end
  end

  describe '#maybe?' do
    context 'when maybe' do
      it 'should return true' do
        mock_graph :get, 'smartday/maybe/uid', 'events/invited/unsure', :access_token => 'access_token' do
          event.maybe?(
            FbGraph::User.new('uid')
          ).should be_true
        end
      end
    end

    context 'otherwise' do
      it 'should return false' do
        mock_graph :get, 'smartday/maybe/uid', 'empty', :access_token => 'access_token' do
          event.maybe?(
            FbGraph::User.new('uid')
          ).should be_false
        end
      end
    end
  end

  describe '#maybe!' do
    it 'should return true' do
      mock_graph :post, 'smartday/maybe', 'events/maybe/post_with_valid_access_token' do
        event.maybe!.should be_true
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

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