Sha256: d10dc021038012e7453d8c5d1166fab91d2ea9146f0a5c84555d155bf7a99436
Contents?: true
Size: 1.25 KB
Versions: 1
Compression:
Stored size: 1.25 KB
Contents
require 'spec_helper' describe Facemock::FbGraph::User do let(:facebook_app_id) { "100000000000000" } let(:facebook_app_secret) { "test_secret" } let(:db_name) { ".test" } let(:adapter) { "sqlite3" } let(:table_names) { [:users, :user_rights] } let(:db_directory) { File.expand_path("../../../../db", __FILE__) } let(:db_filepath) { File.join(db_directory, "#{db_name}.#{adapter}") } before do stub_const("Facemock::Config::Database::DEFAULT_DB_NAME", db_name) Facemock::Config.database end after { Facemock::Config.database.drop } describe '.me' do context 'when access_token is correct' do before do app = Facemock::FbGraph::Application.new(facebook_app_id, secret: facebook_app_secret) @user = app.test_user! @access_token = @user.access_token end it 'can get user' do user = Facemock::FbGraph::User.me(@access_token) Facemock::FbGraph::Application::User.column_names.each do |column| expect(user.send(column)).to eq @user.send(column) unless column == "created_at" end end end context 'when access_token is incorrect' do subject { Facemock::FbGraph::User.me('incorrect_token') } it { is_expected.to eq nil } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
facemock-0.0.2 | spec/facemock/fb_graph/user_spec.rb |