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.
@@ -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
@@ -14,7 +14,11 @@ end
14
14
 
15
15
  # spec_helper.rb
16
16
  RSpec.configure do |c|
17
- c.include Warden::Test::ControllerHelpers
17
+ c.include Warden::Test::ControllerHelpers, type: :controller
18
+
19
+ def sign_in(user)
20
+ warden.set_user(user)
21
+ end
18
22
  end
19
23
  ```
20
24
 
@@ -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
- before(:each) do
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 == 'RailsWarden::Manager'}.block)
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
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "warden-rspec-rails"
6
- s.version = '0.1.0'
6
+ s.version = '0.2.0'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Alex Sharp"]
9
9
  s.email = ["ajsharp@gmail.com"]
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.1.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: 2013-04-06 00:00:00.000000000 Z
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: 1.8.25
43
+ rubygems_version: 2.4.3
46
44
  signing_key:
47
- specification_version: 3
45
+ specification_version: 4
48
46
  summary: Rails controller spec helpers for warden.
49
47
  test_files: []