devise-remote-user 0.3.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ruby.yml +53 -0
  3. data/.gitignore +1 -0
  4. data/Gemfile +37 -1
  5. data/LICENSE +2 -2
  6. data/README.md +7 -2
  7. data/Rakefile +4 -8
  8. data/{devise_remote_user.gemspec → devise-remote-user.gemspec} +3 -3
  9. data/lib/devise-remote-user.rb +1 -0
  10. data/lib/devise_remote_user.rb +20 -14
  11. data/lib/devise_remote_user/controller_behavior.rb +1 -1
  12. data/lib/devise_remote_user/manager.rb +15 -10
  13. data/lib/devise_remote_user/model.rb +3 -5
  14. data/lib/devise_remote_user/strategy.rb +1 -1
  15. data/lib/devise_remote_user/version.rb +1 -1
  16. data/spec/controllers/application_controller_spec.rb +11 -11
  17. data/spec/controllers/devise/sessions_controller_spec.rb +2 -3
  18. data/spec/lib/devise_remote_user_spec.rb +50 -0
  19. data/spec/spec_helper.rb +36 -8
  20. data/spec/{dummy/db/migrate → test_app_templates}/20131101184256_add_name_fields_to_user.rb +1 -1
  21. data/spec/test_app_templates/lib/generators/test_app_generator.rb +34 -0
  22. metadata +45 -157
  23. data/spec/controllers/application_controller_spec.rb~ +0 -9
  24. data/spec/controllers/devise/sessions_controller_spec.rb~ +0 -20
  25. data/spec/dummy/README.rdoc +0 -28
  26. data/spec/dummy/Rakefile +0 -6
  27. data/spec/dummy/app/assets/images/.keep +0 -0
  28. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  29. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  30. data/spec/dummy/app/controllers/application_controller.rb +0 -13
  31. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  33. data/spec/dummy/app/mailers/.keep +0 -0
  34. data/spec/dummy/app/models/.keep +0 -0
  35. data/spec/dummy/app/models/concerns/.keep +0 -0
  36. data/spec/dummy/app/models/user.rb +0 -4
  37. data/spec/dummy/app/models/user.rb~ +0 -6
  38. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  39. data/spec/dummy/bin/bundle +0 -3
  40. data/spec/dummy/bin/rails +0 -4
  41. data/spec/dummy/bin/rake +0 -4
  42. data/spec/dummy/config.ru +0 -4
  43. data/spec/dummy/config/application.rb +0 -23
  44. data/spec/dummy/config/boot.rb +0 -5
  45. data/spec/dummy/config/database.yml +0 -25
  46. data/spec/dummy/config/environment.rb +0 -5
  47. data/spec/dummy/config/environments/development.rb +0 -29
  48. data/spec/dummy/config/environments/production.rb +0 -80
  49. data/spec/dummy/config/environments/test.rb +0 -36
  50. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  51. data/spec/dummy/config/initializers/devise.rb +0 -258
  52. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  53. data/spec/dummy/config/initializers/inflections.rb +0 -16
  54. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  55. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  56. data/spec/dummy/config/initializers/session_store.rb +0 -3
  57. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  58. data/spec/dummy/config/locales/devise.en.yml +0 -60
  59. data/spec/dummy/config/locales/en.yml +0 -23
  60. data/spec/dummy/config/routes.rb +0 -4
  61. data/spec/dummy/db/migrate/20131101150807_devise_create_users.rb +0 -42
  62. data/spec/dummy/db/migrate/20131101184256_add_name_fields_to_user.rb~ +0 -4
  63. data/spec/dummy/db/schema.rb +0 -38
  64. data/spec/dummy/lib/assets/.keep +0 -0
  65. data/spec/dummy/log/.keep +0 -0
  66. data/spec/dummy/public/404.html +0 -58
  67. data/spec/dummy/public/422.html +0 -58
  68. data/spec/dummy/public/500.html +0 -57
  69. data/spec/dummy/public/favicon.ico +0 -0
  70. data/spec/dummy/spec/features/#logout_spec.rb# +0 -1
  71. data/spec/factories/user_factories.rb~ +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5c22c1528b31943554d224bf190fcc0ff7abb81c
4
- data.tar.gz: c5dd7031e1926d72301aac9694ae375e317802a3
2
+ SHA256:
3
+ metadata.gz: b0bc0c09a06a85bf6f7687427ed0d69edbbc88ba8226e7f2bac9681f32899b32
4
+ data.tar.gz: 9c33250b5d3030529833b9f201400dbdc7ff665bca38fb752746d7cfa2915afa
5
5
  SHA512:
6
- metadata.gz: 75dac7385bbdb025cac7159f6e14b6ab40d28ca3eaa3cc0abd520b05a3161cc2da80f9f8c03d622f7b5ee6fdf6a849ec8c7670c472ad76b7d97651bc2fc945fb
7
- data.tar.gz: 526eb0280f61dc90f3d7cd3261a4528af94c31d8548a2b8881ed2e55e6ddf2c6d544e87ec082baf1f7775b98fe3ff314234495e71d2fd19532d31ced3483d01b
6
+ metadata.gz: fac419491667ab37ac90bb2e12902bd10288567ddc5ee9bf879651702fb0b19bce14cdd254e07c82f9f8aab4f40f3bc50980852205b49b52c76fef6b4d80c586
7
+ data.tar.gz: 2e1c68da7663909782cce96a34d5b1e58b648c46f35adb388e655534dc346b4bbac81cb550034d30a2e0968fa17da08fee2756ac98b992ace040d3be2fc07833
@@ -0,0 +1,53 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby: [2.6, 2.7]
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ - name: Install dependencies
29
+ run: bundle install
30
+ - name: Run tests
31
+ run: bundle exec rake ci
32
+ env:
33
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
34
+ test_rails5:
35
+ runs-on: ubuntu-latest
36
+ strategy:
37
+ matrix:
38
+ ruby: [2.6, 2.7]
39
+ steps:
40
+ - uses: actions/checkout@v2
41
+ - name: Set up Ruby
42
+ uses: ruby/setup-ruby@v1
43
+ with:
44
+ ruby-version: ${{ matrix.ruby }}
45
+ - name: Install dependencies
46
+ run: bundle install
47
+ env:
48
+ RAILS_VERSION: 5.2.4.4
49
+ - name: Run tests
50
+ run: bundle exec rake ci
51
+ env:
52
+ RAILS_VERSION: 5.2.4.4
53
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ tmp
21
21
  .yardoc
22
22
  _yardoc
23
23
  doc/
24
+ .internal_test_app
data/Gemfile CHANGED
@@ -1,3 +1,39 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec
4
+
5
+ gem "coveralls", require: false
6
+
7
+ # BEGIN ENGINE_CART BLOCK
8
+ # engine_cart: 0.10.0
9
+ # engine_cart stanza: 0.10.0
10
+ # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
11
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
12
+ if File.exist?(file)
13
+ begin
14
+ eval_gemfile file
15
+ rescue Bundler::GemfileError => e
16
+ Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
17
+ Bundler.ui.warn e.message
18
+ end
19
+ else
20
+ Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
21
+
22
+ if ENV['RAILS_VERSION']
23
+ if ENV['RAILS_VERSION'] == 'edge'
24
+ gem 'rails', github: 'rails/rails'
25
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
26
+ else
27
+ gem 'rails', ENV['RAILS_VERSION']
28
+ end
29
+ end
30
+
31
+ case ENV['RAILS_VERSION']
32
+ when /^6.0/
33
+ gem 'sass-rails', '>= 6'
34
+ # gem 'webpacker', '~> 4.0'
35
+ when /^5.[12]/
36
+ gem 'sass-rails', '~> 5.0'
37
+ end
38
+ end
39
+ # END ENGINE_CART BLOCK
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013, Duke University Libraries
1
+ Copyright (c) Duke University.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
@@ -11,7 +11,7 @@ are permitted provided that the following conditions are met:
11
11
  list of conditions and the following disclaimer in the documentation and/or
12
12
  other materials provided with the distribution.
13
13
 
14
- Neither the name of the {organization} nor the names of its
14
+ Neither the name of Duke University nor the names of its
15
15
  contributors may be used to endorse or promote products derived from
16
16
  this software without specific prior written permission.
17
17
 
data/README.md CHANGED
@@ -3,6 +3,11 @@ devise-remote-user
3
3
 
4
4
  A devise extension for remote user authentication.
5
5
 
6
+ [![Gem Version](https://badge.fury.io/rb/devise-remote-user.svg)](http://badge.fury.io/rb/devise-remote-user)
7
+ [![Build Status](https://github.com/duke-libraries/devise-remote-user/workflows/CI/badge.svg)](https://github.com/duke-libraries/devise-remote-user/actions?query=branch%3Amaster)
8
+ [![Coverage Status](https://coveralls.io/repos/duke-libraries/devise-remote-user/badge.png?branch=master)](https://coveralls.io/r/duke-libraries/devise-remote-user?branch=master)
9
+ [![Code Climate](https://codeclimate.com/github/duke-libraries/devise-remote-user/badges/gpa.svg)](https://codeclimate.com/github/duke-libraries/devise-remote-user)
10
+
6
11
  ## Installation
7
12
 
8
13
  Add to Gemfile:
@@ -24,7 +29,7 @@ Sorry, there are no generators yet, so ...
24
29
 
25
30
  Configuration options:
26
31
 
27
- - `env_var` - String (default: `'REMOTE_USER'`). Request environment key for the remote user id.
32
+ - `env_key` - String (default: `'REMOTE_USER'`). Request environment key for the remote user id.
28
33
  - `attribute_map` - Hash (default: `{}`). Map of User model attributes to request environment keys for updating the local user when auto-creation is enabled.
29
34
  - `auto_create` - Boolean (default: `false`). Whether to auto-create a local user from the remote user attributes. Note: Also requires adding the Warden callbacks as shown below.
30
35
  - `auto_update` - Boolean (default: `false`). Whether to auto-update authenticated user attributes from remote user attributes.
@@ -46,4 +51,4 @@ end
46
51
 
47
52
  ## Tests
48
53
 
49
- `rake spec` runs the test suite.
54
+ `rake ci` runs the test suite.
data/Rakefile CHANGED
@@ -4,17 +4,13 @@ rescue LoadError
4
4
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
5
  end
6
6
 
7
- APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
8
- load 'rails/tasks/engine.rake'
9
-
10
7
  Bundler::GemHelper.install_tasks
11
8
 
12
- Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }
9
+ task default: :ci
13
10
 
14
- require 'rspec/core'
15
11
  require 'rspec/core/rake_task'
12
+ RSpec::Core::RakeTask.new(:spec)
16
13
 
17
- desc "Run all specs in spec directory (excluding plugin specs)"
18
- RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
14
+ require 'engine_cart/rake_task'
19
15
 
20
- task :default => :spec
16
+ task ci: ['engine_cart:generate', 'spec']
@@ -18,10 +18,10 @@ Gem::Specification.new do |s|
18
18
  s.test_files = Dir["spec/**/*"]
19
19
  s.extra_rdoc_files = ["LICENSE", "README.md"]
20
20
  s.require_paths = ["lib"]
21
- s.add_dependency "rails", ">= 3.2", "< 5.0"
22
21
  s.add_dependency "devise"
23
22
  s.add_development_dependency "sqlite3"
24
- s.add_development_dependency "rspec-rails", "~> 2.14.1"
23
+ s.add_development_dependency "rspec-rails", "~> 3.4"
25
24
  s.add_development_dependency "factory_girl_rails"
26
25
  s.add_development_dependency "capybara"
27
- end
26
+ s.add_development_dependency "engine_cart", "~> 2.0"
27
+ end
@@ -0,0 +1 @@
1
+ require 'devise_remote_user'
@@ -3,38 +3,45 @@ require 'devise_remote_user/engine'
3
3
  require 'devise_remote_user/controller_behavior'
4
4
 
5
5
  module DeviseRemoteUser
6
+ class << self
7
+ attr_accessor :env_key, :auto_create, :auto_update, :auth_key, :attribute_map, :logout_url
8
+ end
6
9
 
7
10
  # request.env key for remote user name
8
11
  # Set to 'HTTP_REMOTE_USER' in config/initializers/devise.rb if behind reverse proxy
9
- mattr_accessor :env_key
10
- @@env_key = 'REMOTE_USER'
11
-
12
+ self.env_key = 'REMOTE_USER'
13
+
12
14
  # Enable user auto-creation of user from remote user attributes
13
- mattr_accessor :auto_create
14
- @@auto_create = false
15
+ self.auto_create = false
15
16
 
16
17
  # Enable user auto-update of user attributes from remote user attributes
17
- mattr_accessor :auto_update
18
- @@auto_update = false
18
+ self.auto_update = false
19
19
 
20
20
  # User attribute used for lookup of remote user
21
21
  # Defaults to Devise.authentication_keys.first
22
- mattr_accessor :auth_key
23
- @@auth_key = nil
22
+ self.auth_key = nil
24
23
 
25
24
  # Map of User model attributes to request.env keys for updating a local user when auto-creation is enabled.
26
- mattr_accessor :attribute_map
27
- @@attribute_map = {}
25
+ self.attribute_map = {}
28
26
 
29
27
  # Settings for redirecting to the remote user logout URL
30
28
  # Enable by including DeviseRemoteUser::Controllers::Helpers in ApplicationController
31
29
  # (it overrides Devise's after_sign_out_path_for method).
32
- mattr_accessor :logout_url
33
- @@logout_url = '/'
30
+ self.logout_url = '/'
31
+
34
32
 
35
33
  def self.configure
36
34
  yield self
37
35
  end
36
+
37
+ def self.remote_user_id env
38
+ case env_key
39
+ when Proc
40
+ env_key.call(env)
41
+ else
42
+ env[env_key]
43
+ end
44
+ end
38
45
 
39
46
  end
40
47
 
@@ -42,4 +49,3 @@ Devise.add_module(:remote_user_authenticatable,
42
49
  :strategy => true,
43
50
  :controller => :sessions,
44
51
  :model => 'devise_remote_user/model')
45
-
@@ -9,7 +9,7 @@ module DeviseRemoteUser
9
9
  private
10
10
 
11
11
  def remote_user_authenticated?
12
- request.env[DeviseRemoteUser.env_key].present?
12
+ DeviseRemoteUser.remote_user_id(request.env).present?
13
13
  end
14
14
 
15
15
  end
@@ -1,14 +1,15 @@
1
1
  module DeviseRemoteUser
2
2
 
3
3
  #
4
- # The Manager class is responsible for connecting the appliation's User
4
+ # The Manager class is responsible for connecting the appliation's User
5
5
  # class with remote user information in the request environment.
6
6
  #
7
7
  class Manager
8
8
 
9
- attr_reader :env
10
-
11
- def initialize(env)
9
+ attr_reader :klass, :env
10
+
11
+ def initialize(klass, env)
12
+ @klass = klass
12
13
  @env = env
13
14
  end
14
15
 
@@ -22,21 +23,25 @@ module DeviseRemoteUser
22
23
  end
23
24
 
24
25
  def find_user
25
- User.where(user_criterion).first
26
+ klass.where(user_criterion).first
26
27
  end
27
28
 
28
29
  def create_user
30
+ unless Devise.mappings[:user].strategies.include?(:database_authenticatable)
31
+ return klass.create(user_criterion)
32
+ end
33
+
29
34
  random_password = SecureRandom.hex(16)
30
35
  attrs = user_criterion.merge({password: random_password, password_confirmation: random_password})
31
- User.create(attrs)
36
+ klass.create(attrs)
32
37
  end
33
38
 
34
39
  def update_user(user)
35
- user.update_attributes(remote_user_attributes)
40
+ user.update(remote_user_attributes)
36
41
  end
37
42
 
38
43
  protected
39
-
44
+
40
45
  def remote_user_attributes
41
46
  DeviseRemoteUser.attribute_map.inject({}) { |h, (k, v)| h[k] = env[v] if env.has_key?(v); h }
42
47
  end
@@ -46,13 +51,13 @@ module DeviseRemoteUser
46
51
  end
47
52
 
48
53
  def remote_user_id
49
- env[DeviseRemoteUser.env_key]
54
+ DeviseRemoteUser.remote_user_id(env)
50
55
  end
51
56
 
52
57
  def auth_key
53
58
  DeviseRemoteUser.auth_key || Devise.authentication_keys.first
54
59
  end
55
-
60
+
56
61
  end
57
62
 
58
63
  end
@@ -5,13 +5,11 @@ module Devise::Models
5
5
  module RemoteUserAuthenticatable
6
6
  extend ActiveSupport::Concern
7
7
 
8
- module ClassMethods
9
-
10
- def find_for_remote_user_authentication(env)
11
- manager = DeviseRemoteUser::Manager.new(env)
8
+ included do
9
+ def self.find_for_remote_user_authentication(env)
10
+ manager = DeviseRemoteUser::Manager.new(self, env)
12
11
  manager.find_or_create_user
13
12
  end
14
-
15
13
  end
16
14
 
17
15
  end
@@ -6,7 +6,7 @@ module Devise
6
6
  class RemoteUserAuthenticatable < Authenticatable
7
7
 
8
8
  def valid?
9
- env[DeviseRemoteUser.env_key].present?
9
+ DeviseRemoteUser.remote_user_id(env).present?
10
10
  end
11
11
 
12
12
  def authenticate!
@@ -1,3 +1,3 @@
1
1
  module DeviseRemoteUser
2
- VERSION = '0.3.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ApplicationController do
3
+ RSpec.describe ApplicationController, type: :controller do
4
4
 
5
5
  controller do
6
6
  def remote_user_name=(user_name)
@@ -21,7 +21,7 @@ describe ApplicationController do
21
21
  before { controller.remote_user_name = user.email }
22
22
  it "should login the remote user" do
23
23
  get :index
24
- expect(controller.user_signed_in?).to be_true
24
+ expect(controller.user_signed_in?).to eq true
25
25
  expect(controller.current_user).to eq(user)
26
26
  end
27
27
  end
@@ -30,7 +30,7 @@ describe ApplicationController do
30
30
  before { controller.remote_user_name = nil }
31
31
  it "should do nothing" do
32
32
  get :index
33
- expect(controller.user_signed_in?).to be_false
33
+ expect(controller.user_signed_in?).to eq false
34
34
  end
35
35
  end
36
36
 
@@ -43,18 +43,18 @@ describe ApplicationController do
43
43
  it "should create and sign in a new user" do
44
44
  get :index
45
45
  expect(response).to be_successful
46
- expect(controller.user_signed_in?).to be_true
46
+ expect(controller.user_signed_in?).to eq true
47
47
  expect(User.find_by_email(email)).to eq(controller.current_user)
48
48
  end
49
49
  end
50
50
 
51
51
  describe "and auto-creation is disabled" do
52
- before { allow(DeviseRemoteUser).to receive(:auto_create) { false } }
52
+ before { allow(DeviseRemoteUser).to receive(:auto_create).and_return(false) }
53
53
  it "should not create a user for the remote user" do
54
54
  get :index
55
- response.should_not be_successful
56
- controller.user_signed_in?.should be_false
57
- User.find_by_email(email).should be_nil
55
+ expect(response).to_not be_successful
56
+ expect(controller.user_signed_in?).to eq false
57
+ expect(User.find_by_email(email)).to be_nil
58
58
  end
59
59
  end
60
60
  end
@@ -62,7 +62,7 @@ describe ApplicationController do
62
62
  describe "when a local database user is already signed in" do
63
63
  let(:local_user) { FactoryGirl.create(:user) }
64
64
  before do
65
- allow(DeviseRemoteUser).to receive(:auto_create) { true }
65
+ allow(DeviseRemoteUser).to receive(:auto_create).and_return(true)
66
66
  controller.remote_user_name = remote_user.email
67
67
  sign_in local_user
68
68
  end
@@ -100,7 +100,7 @@ describe ApplicationController do
100
100
 
101
101
  describe "when auto-creation is disabled" do
102
102
  before do
103
- allow(DeviseRemoteUser).to receive(:auto_update) { false }
103
+ allow(DeviseRemoteUser).to receive(:auto_update).and_return(false)
104
104
  controller.remote_user_name = user.email
105
105
  controller.remote_user_attributes = {
106
106
  'givenName' => 'Fleece',
@@ -121,7 +121,7 @@ describe ApplicationController do
121
121
 
122
122
  describe "when auto-creation is enabled" do
123
123
  before do
124
- allow(DeviseRemoteUser).to receive(:auto_update) { true }
124
+ allow(DeviseRemoteUser).to receive(:auto_update).and_return(true)
125
125
  controller.remote_user_attributes = {
126
126
  'givenName' => 'Fleece',
127
127
  'sn' => 'Vest',
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Devise::SessionsController do
3
+ RSpec.describe Devise::SessionsController, type: :controller do
4
4
  before { @request.env["devise.mapping"] = Devise.mappings[:user] }
5
5
  describe "logout" do
6
6
  let(:user) { FactoryGirl.create(:user) }
@@ -12,9 +12,8 @@ describe Devise::SessionsController do
12
12
  end
13
13
  describe "when user is not remotely authenticated" do
14
14
  it "should redirect to the root path (Devise default)" do
15
- expect(get :destroy).to redirect_to(root_path)
15
+ expect(get :destroy).to redirect_to('/')
16
16
  end
17
17
  end
18
18
  end
19
-
20
19
  end