Sha256: 9bb520550e62471959ad8472f9710b826f27da65d9676d328f7390fb3c5134f7

Contents?: true

Size: 1.3 KB

Versions: 62

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Scores do
  let(:user) { FbGraph::User.new('matake', :access_token => 'user_access_token') }
  let(:app) { FbGraph::Application.new('FbGraph', :access_token => 'app_access_token') }

  describe '#scores' do
    it 'should return an Array of Score' do
      mock_graph :get, 'matake/scores', 'users/scores/sample', :access_token => 'user_access_token' do
        scores = user.scores
        scores.should be_a Array
        scores.should_not be_blank
        scores.each do |score|
          score.should be_instance_of FbGraph::Score
          score.user.should be_instance_of FbGraph::User
          score.application.should be_instance_of FbGraph::Application
          score.score.should be_a Integer
        end
      end
    end
  end

  describe '#score!' do
    it 'should return true' do
      mock_graph :post, 'matake/scores', 'true', :access_token => 'app_access_token', :params => {
        :score => '10'
      } do
        user.score!(10, :access_token => app.access_token).should be_true
      end
    end
  end

  describe '#unscore!' do
    it 'should return true' do
      mock_graph :delete, 'matake/scores', 'true', :access_token => 'app_access_token' do
        user.unscore!(:access_token => app.access_token).should be_true
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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