Last active
October 10, 2016 16:02
-
-
Save thiagoa/9cfa80059476e8a0f690c9fc0c50d55f to your computer and use it in GitHub Desktop.
First twitter client factory spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/models/twitter_client_factory_spec.rb | |
require 'twitter' | |
require 'spec_helper' | |
require_relative '../../app/models/twitter_client_factory' | |
RSpec.describe TwitterClientFactory do | |
describe '#call' do | |
it 'builds a twitter client class with the passed config' do | |
instance = TwitterClientFactory.new.call( | |
'consumer_key' => 'ck', | |
'consumer_secret' => 'cs', | |
'access_token' => 'at', | |
'access_token_secret' => 'ats' | |
) | |
expect(instance).to be_a Twitter::REST::Client | |
expect(instance).to have_attributes( | |
'consumer_key' => 'ck', | |
'consumer_secret' => 'cs', | |
'access_token' => 'at', | |
'access_token_secret' => 'ats' | |
) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment