
- Re-factor - Remove code for notifications - Remove addons - Remove travis-core gem. - Ignore logs directory only - Move core tests to spec/lib
30 lines
794 B
Ruby
30 lines
794 B
Ruby
describe User::Oauth do
|
|
let(:user) { Factory(:user, :github_oauth_token => 'token') }
|
|
let(:payload) { GITHUB_PAYLOADS[:oauth] }
|
|
|
|
describe 'find_or_create_by' do
|
|
def call(payload)
|
|
User::Oauth.find_or_create_by(payload)
|
|
end
|
|
|
|
it 'marks users as recently_signed_up' do
|
|
call(payload).should be_recently_signed_up
|
|
end
|
|
|
|
it 'does not mark existing users as recently_signed_up' do
|
|
call(payload)
|
|
call(payload).should_not be_recently_signed_up
|
|
end
|
|
|
|
it 'updates changed attributes' do
|
|
call(payload).attributes.slice(*GITHUB_OAUTH_DATA.keys).should == GITHUB_OAUTH_DATA
|
|
end
|
|
end
|
|
|
|
describe 'attributes_from' do
|
|
it 'returns required data' do
|
|
User::Oauth.attributes_from(payload).should == GITHUB_OAUTH_DATA
|
|
end
|
|
end
|
|
end
|