Permalink
Browse files

Test User creation from oauth

  • Loading branch information...
1 parent 128e7fa commit 820ce07d77f0bca13c634621c24bf6d5f1d854d5 Omar Vargas committed May 29, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 spec/models/user_spec.rb
View
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe User do
+ describe :new_from_oauth do
+ let(:oauth_hash) do
+ obj = Object.new
+ obj.stub(:info => {"email" => "test@example.com", "name" => "John Smith"},
+ :credentials => {"token" => "A123", "refresh_token" => "B1234"})
+ obj
+ end
+
+ it "should create a new User instance" do
+ user = User.new_from_oauth(oauth_hash)
+ user.should be_instance_of(User)
+ end
+ end
+end

0 comments on commit 820ce07

Please sign in to comment.