added cucumber test for re-registering a pod from a client

This commit is contained in:
danielgrippi 2011-06-23 18:57:39 -07:00
parent 63125cb9b9
commit bd84eaaf75
6 changed files with 32 additions and 14 deletions

View file

@ -96,6 +96,6 @@ group :test do
gem 'rspec-instafail', '>= 0.1.7', :require => false gem 'rspec-instafail', '>= 0.1.7', :require => false
gem 'fuubar' gem 'fuubar'
gem 'diaspora-client', #:git => 'git@github.com:diaspora/diaspora-client.git' gem 'diaspora-client', :git => 'git@github.com:diaspora/diaspora-client.git'
:path => "~/workspace/diaspora-client" #:path => "~/work/diaspora-client"
end end

View file

@ -38,14 +38,8 @@ GIT
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
GIT GIT
remote: https://github.com/zhitomirskiyi/ruby-jwt remote: git@github.com:diaspora/diaspora-client.git
revision: fa7f46b5ac3653e30cf60abc78de9ffb3319dc0c revision: 6b1b07fba73106755acd77d6def3e503df007a3f
specs:
jwt (0.1.3)
json (>= 1.2.4)
PATH
remote: ~/workspace/diaspora-client
specs: specs:
diaspora-client (0.0.0) diaspora-client (0.0.0)
activerecord activerecord
@ -54,6 +48,13 @@ PATH
oauth2 oauth2
sinatra sinatra
GIT
remote: https://github.com/zhitomirskiyi/ruby-jwt
revision: fa7f46b5ac3653e30cf60abc78de9ffb3319dc0c
specs:
jwt (0.1.3)
json (>= 1.2.4)
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:

View file

@ -66,3 +66,14 @@ Feature: oauth
And I follow "Revoke Access" And I follow "Revoke Access"
Then I visit "/account?id=1" on Chubbies Then I visit "/account?id=1" on Chubbies
Then I should see "Token invalid" Then I should see "Token invalid"
Scenario: Re-registering a client if the client recognizes the diaspora pod but the diaspora pod has since been reset
Given Chubbies is registered on my pod
And I remove all traces of Chubbies on the pod
When I try to authorize Chubbies
When I press "Authorize"
Then I should be on "/account" on Chubbies
And I should see my "profile.birthday"
And I should see my "name"

View file

@ -26,6 +26,10 @@ And /^there is only one Chubbies$/ do
OAuth2::Provider.client_class.where(:name => "Chubbies").count.should == 1 OAuth2::Provider.client_class.where(:name => "Chubbies").count.should == 1
end end
And /^I remove all traces of Chubbies on the pod$/ do
OAuth2::Provider.client_class.destroy_all
end
When /^I try to authorize Chubbies$/ do When /^I try to authorize Chubbies$/ do
# We need to reset the tokens saved in Chubbies, # We need to reset the tokens saved in Chubbies,
# as we are clearing the Diaspora DB every scenario # as we are clearing the Diaspora DB every scenario

View file

@ -7,5 +7,6 @@ gem 'json'
gem 'shotgun' gem 'shotgun'
gem 'sqlite3' gem 'sqlite3'
gem 'activerecord', '3.0.3' gem 'activerecord', '3.0.3'
gem 'diaspora-client', :path => "~/workspace/diaspora-client" gem 'diaspora-client', :git => 'git@github.com:diaspora/diaspora-client.git'
#:git => 'git@github.com:diaspora/diaspora-client.git' #:path => "~/work/diaspora-client"

View file

@ -1,5 +1,6 @@
PATH GIT
remote: ~/workspace/diaspora-client remote: git@github.com:diaspora/diaspora-client.git
revision: 6b1b07fba73106755acd77d6def3e503df007a3f
specs: specs:
diaspora-client (0.0.0) diaspora-client (0.0.0)
activerecord activerecord