warden-rspec-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +5 -1
- data/lib/warden/test/controller_helpers.rb +4 -9
- data/warden-rspec-rails.gemspec +1 -1
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 775e119dbbccddb56df09cc3e85b1596416a4566
|
4
|
+
data.tar.gz: c6123ec1878a5ba17db9c7f211118cb3289ec86a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ee985ecdebd18d5467ec4d34ae89dc441ec666fc3a9d994fccff381ce9e7f9821ba70641cc81e5c6f6686c6790d4b6b8aac408d7a4d5d26b1ba3ee574f608b32
|
7
|
+
data.tar.gz: b76c954b5f715e83041ac727045a896a94fa5fbbd332374e6935de3e7ad044df7cc4ec2ccc2eed98891c9b24fe3d4ebaacbca37a9a3fc94f4b6e51a54c075963
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# test/test_helpers/warden.rb
|
2
2
|
|
3
|
+
# Based on http://stackoverflow.com/questions/13420923/configuring-warden-for-use-in-rspec-controller-specs
|
3
4
|
module Warden
|
4
5
|
# Warden::Test::ControllerHelpers provides a facility to test controllers in isolation
|
5
6
|
# Most of the code was extracted from Devise's Devise::TestHelpers.
|
@@ -7,13 +8,7 @@ module Warden
|
|
7
8
|
module ControllerHelpers
|
8
9
|
def self.included(base)
|
9
10
|
base.class_eval do
|
10
|
-
|
11
|
-
setup_controller_for_warden
|
12
|
-
end
|
13
|
-
|
14
|
-
before(:each) do
|
15
|
-
warden
|
16
|
-
end
|
11
|
+
setup :setup_controller_for_warden, :warden if respond_to?(:setup)
|
17
12
|
end
|
18
13
|
end
|
19
14
|
|
@@ -31,7 +26,7 @@ module Warden
|
|
31
26
|
# Quick access to Warden::Proxy.
|
32
27
|
def warden
|
33
28
|
@warden ||= begin
|
34
|
-
manager = Warden::Manager.new(nil, &Rails.application.config.middleware.detect{|m| m.name == '
|
29
|
+
manager = Warden::Manager.new(nil, &Rails.application.config.middleware.detect{|m| m.name == 'Warden::Manager'}.block)
|
35
30
|
@request.env['warden'] = Warden::Proxy.new(@request.env, manager)
|
36
31
|
end
|
37
32
|
end
|
@@ -62,4 +57,4 @@ module Warden
|
|
62
57
|
end
|
63
58
|
end
|
64
59
|
end
|
65
|
-
end
|
60
|
+
end
|
data/warden-rspec-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warden-rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Alex Sharp
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Rails controller spec helpers for warden.
|
15
14
|
email:
|
@@ -24,26 +23,25 @@ files:
|
|
24
23
|
- warden-rspec-rails.gemspec
|
25
24
|
homepage: https://github.com/ajsharp/warden-rspec-rails
|
26
25
|
licenses: []
|
26
|
+
metadata: {}
|
27
27
|
post_install_message:
|
28
28
|
rdoc_options: []
|
29
29
|
require_paths:
|
30
30
|
- lib
|
31
31
|
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
-
none: false
|
33
32
|
requirements:
|
34
|
-
- -
|
33
|
+
- - ">="
|
35
34
|
- !ruby/object:Gem::Version
|
36
35
|
version: '0'
|
37
36
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
|
-
none: false
|
39
37
|
requirements:
|
40
|
-
- -
|
38
|
+
- - ">="
|
41
39
|
- !ruby/object:Gem::Version
|
42
40
|
version: '0'
|
43
41
|
requirements: []
|
44
42
|
rubyforge_project:
|
45
|
-
rubygems_version:
|
43
|
+
rubygems_version: 2.4.3
|
46
44
|
signing_key:
|
47
|
-
specification_version:
|
45
|
+
specification_version: 4
|
48
46
|
summary: Rails controller spec helpers for warden.
|
49
47
|
test_files: []
|