Permalink
Browse files

Bringing over omniauth registration tests

  • Loading branch information...
1 parent e0a5a9a commit 72d90cb567021ed382cddf04b6207aa152714433 @bigfleet committed Mar 14, 2011
View
@@ -5,7 +5,7 @@ class User < ActiveRecord::Base
has_many :talks
def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
- data = access_token['extra']['user_hash']
+ data = access_token['user_info']
if user = User.find_by_email(data["email"])
user
else # Create an user with a stub password.
@@ -0,0 +1,10 @@
+Feature: Login using Facebook
+ In order to compete with my friends as quickly as possible without remembering another password
+ As a WGTC user
+ I want to register with Facebook
+
+Scenario: Registration
+ Given I register with Facebook
+ When I am on the home page
+ And I follow "Sign in with Facebook"
+ Then there should be "1" user
@@ -0,0 +1,14 @@
+Feature: Log in using only our site
+ In order to compete with my friends as quickly as possible without opening a stupid Facebook or Twitter account
+ As a WGTC user
+ I want to use my WGTC registration credentials to log in
+
+Scenario: Registration success
+ Given I register with email "jim@jimvanfleet.com" and password "testing"
+ When I am on the home page
+ And I follow "Sign in"
+ And I fill in "Email" with "jim@jimvanfleet.com"
+ And I fill in "Password" with "testing"
+ And I press "Sign in"
+ Then I should see "Hi,"
+
@@ -0,0 +1,10 @@
+Feature: Sign in using Twitter
+ In order to compete with my friends as quickly as possible without remembering another password
+ As a WGTC user
+ I want to sign in with Twitter
+
+Scenario: Registration
+ Given "jim@jimvanfleet.com" has registered with Twitter
+ When I am on the home page
+ And I follow "Sign in with Twitter"
+ Then I should see "Hi, bigfleet"
@@ -0,0 +1,9 @@
+Feature: Register using Facebook
+ In order to compete with my friends as quickly as possible without remembering another password
+ As a WGTC user
+ I want to register with Facebook
+
+Scenario: Registration
+ When I am on the home page
+ And I follow "Sign in with Facebook"
+ Then there should be "1" user
@@ -0,0 +1,28 @@
+Feature: Register using only our site
+ In order to compete with my friends as quickly as possible without opening a stupid Facebook or Twitter account
+ As a WGTC user
+ I want to register with WGTC directly
+
+Scenario: Registration requires password
+ When I am on the home page
+ And I follow "Sign up"
+ Then there should be "0" users
+ And I should see "Sign up"
+ When I fill in "Handle" with "bigfleet"
+ And I fill in "Email" with "jim@jimvanfleet.com"
+ And I press "Sign up"
+ Then there should be "0" users
+
+Scenario: Registration success
+ When I am on the home page
+ And I follow "Sign up"
+ Then there should be "0" users
+ And I should see "Sign up"
+ When I fill in "Handle" with "bigfleet"
+ And I fill in "Email" with "jim@jimvanfleet.com"
+ And I fill in "Password" with "testing"
+ And I fill in "Password confirmation" with "testing"
+ And I press "Sign up"
+ Then there should be "1" users
+
+
@@ -0,0 +1,15 @@
+@wip
+Feature: Register using Twitter
+ In order to compete with my friends as quickly as possible without remembering another password
+ As a WGTC user
+ I want to register with Twitter
+
+Scenario: Registration
+ When I am on the home page
+ And I follow "Sign in with Twitter"
+ Then there should be "0" users
+ And I should see "Sign up"
+ And the "Handle" field should contain "bigfleet"
+ When I fill in "Email" with "jim@jimvanfleet.com"
+ And I press "Sign up"
+ Then there should be "1" users

0 comments on commit 72d90cb

Please sign in to comment.