Sha256: 3e236da73cc0be612633301ecb67c01886186d59175087c8394cc437d5b10a45
Contents?: true
Size: 1.3 KB
Versions: 75
Compression:
Stored size: 1.3 KB
Contents
require 'spec_helper' describe FbGraph::Connections::UserAchievements do let(:user) { FbGraph::User.new('matake', :access_token => 'access_token') } describe '#achievements' do it 'should return an Array of FbGraph::UserAchievement' do mock_graph :get, 'matake/achievements', 'users/user_achievements/sample', :access_token => 'access_token' do user.achievements.each do |achievement| achievement.should be_instance_of FbGraph::UserAchievement end end end end describe '#achieve!' do let(:achievement_url) { 'http://fbgraphsample.heroku.com/achievements/1' } it 'should return FbGraph::UserAchievement' do mock_graph :post, 'matake/achievements', 'users/user_achievements/created', :access_token => 'access_token', :params => { :achievement => achievement_url } do user.achieve!(achievement_url).should be_instance_of FbGraph::UserAchievement end end end describe '#unachieve!' do let(:achievement_url) { 'http://fbgraphsample.heroku.com/achievements/1' } it 'should return true' do mock_graph :delete, 'matake/achievements', 'true', :access_token => 'access_token', :params => { :achievement => achievement_url } do user.unachieve!(achievement_url).should be_true end end end end
Version data entries
75 entries across 75 versions & 1 rubygems