hancock-client 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'spec/rake/spectask'
6
6
  require 'cucumber/rake/task'
7
7
 
8
8
  GEM = "hancock-client"
9
- GEM_VERSION = "0.0.5"
9
+ GEM_VERSION = "0.0.6"
10
10
  AUTHOR = "Corey Donohoe"
11
11
  EMAIL = ['atmos@atmos.org', 'tim@spork.in']
12
12
  HOMEPAGE = "http://github.com/atmos/hancock-client"
@@ -23,15 +23,6 @@ module Hancock
23
23
  end
24
24
 
25
25
  register Sinatra::Hancock::SSO
26
-
27
- get '*' do
28
- if session[:user_id]
29
- forward
30
- else
31
- session[:return_to] = request.path_info
32
- redirect "#{options.sso_url}/login?return_to=#{absolute_url('/sso/login')}"
33
- end
34
- end
35
26
  end
36
27
  end
37
28
  end
@@ -9,6 +9,26 @@ describe Sinatra::Hancock::SSO do
9
9
  last_response.headers['Location'].should eql('http://localhost:20000/login?return_to=http://example.org/sso/login')
10
10
  end
11
11
 
12
+ it "should protect the root url from HTTP post" do
13
+ post '/'
14
+ last_response.headers['Location'].should eql('/sso/login')
15
+ end
16
+
17
+ it "should protect the root url from HTTP head" do
18
+ head '/'
19
+ last_response.headers['Location'].should eql('/sso/login')
20
+ end
21
+
22
+ it "should protect the root url from HTTP put" do
23
+ put '/'
24
+ last_response.headers['Location'].should eql('/sso/login')
25
+ end
26
+
27
+ it "should protect the root url from HTTP delete" do
28
+ delete '/'
29
+ last_response.headers['Location'].should eql('/sso/login')
30
+ end
31
+
12
32
  it "should greet the user when authenticated" do
13
33
  pending
14
34
  get '/'
data/spec/spec_helper.rb CHANGED
@@ -7,7 +7,7 @@ gem 'webrat', '~>0.4.2'
7
7
  require 'webrat'
8
8
  require 'dm-sweatshop'
9
9
 
10
- gem 'sinatra', '~>0.9.1'
10
+ gem 'sinatra', '~>0.9.1.3'
11
11
  require 'sinatra/base'
12
12
  require 'sinatra/hancock/sso'
13
13
  gem 'rack-test', '~>0.1.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hancock-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
@@ -9,7 +9,7 @@ autorequire: hancock-client
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-29 00:00:00 -06:00
12
+ date: 2009-05-01 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency