refinerycms-authentication-devise 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/Gemfile +1 -1
- data/app/controllers/refinery/authentication/devise/admin/users_controller.rb +2 -2
- data/app/controllers/refinery/authentication/devise/passwords_controller.rb +4 -8
- data/app/controllers/refinery/authentication/devise/sessions_controller.rb +1 -1
- data/app/models/refinery/authentication/devise/role.rb +2 -1
- data/app/models/refinery/authentication/devise/user.rb +2 -1
- data/app/views/refinery/authentication/devise/admin/users/_user.html.erb +13 -13
- data/app/views/refinery/authentication/devise/passwords/edit.html.erb +1 -1
- data/config/locales/da.yml +2 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/fr.yml +25 -20
- data/config/locales/nl.yml +2 -0
- data/config/locales/ru.yml +17 -8
- data/db/migrate/20100913234705_create_refinerycms_authentication_schema.rb +1 -1
- data/db/migrate/20120301234455_add_slug_to_refinery_users.rb +1 -1
- data/db/migrate/20130805143059_add_full_name_to_refinery_users.rb +1 -1
- data/db/migrate/20150503125200_rename_tables_to_new_namespace.rb +1 -1
- data/readme.md +24 -3
- data/refinerycms-authentication-devise.gemspec +7 -7
- data/spec/controllers/refinery/authentication/devise/admin/users_controller_spec.rb +6 -6
- data/spec/features/refinery/authentication/devise/passwords_spec.rb +3 -0
- data/spec/support/refinery/authentication/devise/controller_macros.rb +1 -1
- metadata +25 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eb3ccdf61df96acbfa82d4b0a097aabb298aa74
|
4
|
+
data.tar.gz: ba081972fc2d5e693546fee03686fb748382eb09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 164aba76a9f740f823ad779f491a497acfab2c17b44a6b3ab52a66c05973d7b3d4295beebc2fe648a70b5ec2bd3e3500bd4d72b2931f9eb9b8f7993682ab16da
|
7
|
+
data.tar.gz: 1705ee9a08d03a3bfece84c017a8419edfcbd71c1d968e9fa430c6a50a4a5140902394385c4acfae6506d2869bca8d539732d55df26c9b89aabc3aa6cb3031f4
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -48,7 +48,7 @@ module Refinery
|
|
48
48
|
store_user_memento
|
49
49
|
|
50
50
|
@user.roles = @selected_role_names.map { |r| Refinery::Authentication::Devise::Role[r.downcase] }
|
51
|
-
if @user.update_attributes user_params
|
51
|
+
if @user.update_attributes user_params.to_h
|
52
52
|
update_successful
|
53
53
|
else
|
54
54
|
update_failed
|
@@ -106,7 +106,7 @@ module Refinery
|
|
106
106
|
private
|
107
107
|
def exclude_password_assignment_when_blank!
|
108
108
|
if params[:user][:password].blank? && params[:user][:password_confirmation].blank?
|
109
|
-
params[:user].
|
109
|
+
params[:user].extract!(:password, :password_confirmation)
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -14,7 +14,7 @@ module Refinery
|
|
14
14
|
# Rather than overriding devise, it seems better to just apply the notice here.
|
15
15
|
after_action :give_notice, :only => [:update]
|
16
16
|
def give_notice
|
17
|
-
if
|
17
|
+
if self.resource.errors.empty?
|
18
18
|
flash[:notice] = t('successful', :scope => 'refinery.authentication.devise.users.reset', :email => self.resource.email)
|
19
19
|
end
|
20
20
|
end
|
@@ -22,13 +22,9 @@ module Refinery
|
|
22
22
|
|
23
23
|
# GET /registrations/password/edit?reset_password_token=abcdef
|
24
24
|
def edit
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
redirect_to refinery.new_authentication_devise_user_password_path,
|
31
|
-
:flash => ({ :error => t('code_invalid', :scope => 'refinery.authentication.devise.users.reset') })
|
25
|
+
self.resource = User.find_or_initialize_with_error_by_reset_password_token(params[:reset_password_token])
|
26
|
+
set_minimum_password_length
|
27
|
+
resource.reset_password_token = params[:reset_password_token]
|
32
28
|
end
|
33
29
|
|
34
30
|
# POST /registrations/password
|
@@ -7,7 +7,7 @@ module Refinery
|
|
7
7
|
|
8
8
|
before_action :clear_unauthenticated_flash, :only => [:new]
|
9
9
|
before_action :force_signup_when_no_users!
|
10
|
-
skip_before_action :detect_authentication_devise_user!, only: [:create]
|
10
|
+
skip_before_action :detect_authentication_devise_user!, only: [:create], raise: false
|
11
11
|
after_action :detect_authentication_devise_user!, only: [:create]
|
12
12
|
|
13
13
|
def create
|
@@ -3,7 +3,8 @@ module Refinery
|
|
3
3
|
module Devise
|
4
4
|
class Role < Refinery::Core::BaseModel
|
5
5
|
|
6
|
-
|
6
|
+
has_many :roles_users, class_name: 'Refinery::Authentication::Devise::RolesUsers'
|
7
|
+
has_many :users, through: :roles_users, class_name: 'Refinery::Authentication::Devise::User'
|
7
8
|
|
8
9
|
before_validation :camelize_title
|
9
10
|
validates :title, :uniqueness => true
|
@@ -8,7 +8,8 @@ module Refinery
|
|
8
8
|
|
9
9
|
extend FriendlyId
|
10
10
|
|
11
|
-
|
11
|
+
has_many :roles_users, class_name: 'Refinery::Authentication::Devise::RolesUsers'
|
12
|
+
has_many :roles, through: :roles_users, class_name: 'Refinery::Authentication::Devise::Role'
|
12
13
|
|
13
14
|
has_many :plugins, -> { order('position ASC') },
|
14
15
|
class_name: "Refinery::Authentication::Devise::UserPlugin", dependent: :destroy
|
@@ -1,3 +1,13 @@
|
|
1
|
+
<% # setup params for various action links
|
2
|
+
edit_url ||= refinery.edit_authentication_devise_admin_user_path(user)
|
3
|
+
delete_url ||= refinery.authentication_devise_admin_user_path(user)
|
4
|
+
delete_options ||= {
|
5
|
+
method: :delete,
|
6
|
+
class: "cancel confirm-delete",
|
7
|
+
data: {confirm: t('message', scope: 'refinery.authentication.devise.delete', title: user.username)}
|
8
|
+
}
|
9
|
+
%>
|
10
|
+
|
1
11
|
<li id="sortable_<%= user.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'>
|
2
12
|
<span class='title'>
|
3
13
|
<strong><%= user.username %></strong>
|
@@ -6,18 +16,8 @@
|
|
6
16
|
</span>
|
7
17
|
</span>
|
8
18
|
<span class='actions'>
|
9
|
-
<%= mail_to user.email,
|
10
|
-
|
11
|
-
<%=
|
12
|
-
refinery.edit_authentication_devise_admin_user_path(user),
|
13
|
-
:title => t('edit', :scope => 'refinery.authentication.devise.admin.users') if current_refinery_user.can_edit?(user) %>
|
14
|
-
<%= link_to refinery_icon_tag('delete.png'),
|
15
|
-
refinery.authentication_devise_admin_user_path(user),
|
16
|
-
:class => "cancel confirm-delete",
|
17
|
-
:title => t('delete', :scope => 'refinery.authentication.devise.admin.users'),
|
18
|
-
:method => :delete,
|
19
|
-
:data => {
|
20
|
-
:confirm => t('message', :scope => 'refinery.authentication.devise.admin.delete', :title => user.username)
|
21
|
-
} if current_refinery_user.can_delete?(user) %>
|
19
|
+
<%= mail_to user.email, '', class: 'email_icon' %>
|
20
|
+
<%= action_icon(:edit, edit_url , t('edit', scope: 'refinery.authentication.devise.admin.users' ) ) if current_refinery_user.can_edit?(user) %>
|
21
|
+
<%= action_icon(:delete, delete_url, t('delete', scope: 'refinery.authentication.devise.admin.users' ), delete_options ) if current_refinery_user.can_delete?(user) %>
|
22
22
|
</span>
|
23
23
|
</li>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= form_for resource, :as => resource_name,
|
4
4
|
:url => refinery.authentication_devise_user_password_path,
|
5
5
|
:html => { :method => :put } do |f| %>
|
6
|
-
<%= f.hidden_field :reset_password_token
|
6
|
+
<%= f.hidden_field :reset_password_token %>
|
7
7
|
|
8
8
|
<%= render '/refinery/admin/error_messages', :object => resource, :include_object_name => true %>
|
9
9
|
|
data/config/locales/da.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/fr.yml
CHANGED
@@ -13,7 +13,7 @@ fr:
|
|
13
13
|
update:
|
14
14
|
lockout_prevented: Vous ne pouvez pas supprimer l'accès au plugin de gestion des utilisateurs pour l'utilisateur sur lequel vous êtes actuellement authentifié.
|
15
15
|
form:
|
16
|
-
blank_password_keeps_current: Laisser le mot de passe vide permet de conserver le mot de passe actuel
|
16
|
+
blank_password_keeps_current: Laisser le mot de passe vide permet de conserver le mot de passe actuel.
|
17
17
|
plugin_access: Plugin d'accès
|
18
18
|
role_access: Rôle d'accès
|
19
19
|
enable_all: tout activer
|
@@ -22,11 +22,22 @@ fr:
|
|
22
22
|
user:
|
23
23
|
email_user: Envoyer un e-mail à cet utilisateur
|
24
24
|
preview: "(%{who}) créé le %{created_at}"
|
25
|
+
delete:
|
26
|
+
message: "Êtes-vous sûr de vouloir supprimer définitivement %{title}?"
|
27
|
+
roles:
|
28
|
+
superuser: Superuser
|
29
|
+
refinery: Refinery
|
25
30
|
sessions:
|
26
31
|
new:
|
27
|
-
hello_please_sign_in: Bonjour
|
32
|
+
hello_please_sign_in: Bonjour! Veuillez vous identifier.
|
28
33
|
sign_in: Authentification
|
29
34
|
forgot_password: J'ai oublié mon mot de passe
|
35
|
+
user_mailer:
|
36
|
+
reset_notification:
|
37
|
+
subject: Lien pour changer votre mot de passe
|
38
|
+
reset_request_received_for: "Une demande de changement de mot de passe a été reçue pour %{username}."
|
39
|
+
visit_this_url: Visitez cette URL pour choisir un nouveau mot de passe.
|
40
|
+
remain_same_if_no_action: Votre mot de passe restera le même si aucune action n'est choisie.
|
30
41
|
users:
|
31
42
|
new:
|
32
43
|
fill_form: Remplissez vos coordonnées ci-dessous pour commencer.
|
@@ -34,32 +45,26 @@ fr:
|
|
34
45
|
create:
|
35
46
|
welcome: "Bienvenue dans Refinery, %{who}"
|
36
47
|
forgot:
|
37
|
-
email_address: Adresse
|
38
|
-
enter_email_address: Veuillez entrer votre adresse
|
48
|
+
email_address: Adresse courriel
|
49
|
+
enter_email_address: Veuillez entrer votre adresse courriel.
|
39
50
|
reset_password: Changer le mot de passe
|
40
|
-
blank_email:
|
41
|
-
email_not_associated_with_account_html: "Désolé, '%{email}' n'est asssocié à aucun compte.<br
|
42
|
-
email_reset_sent: Un
|
51
|
+
blank_email: Vous n'avez pas entré d'adresse courriel.
|
52
|
+
email_not_associated_with_account_html: "Désolé, '%{email}' n'est asssocié à aucun compte.<br />Êtes-vous sûr d'avoir correctement entré votre adresse courriel?"
|
53
|
+
email_reset_sent: Un courriel vous a été envoyé. Il contient un lien vous permettant de changer votre mot de passe.
|
43
54
|
password_encryption: Vous devez modifier votre mot de passe car Refinery utilise de nouvelles méthodes de cryptage. Les nouveaux mots de passe seront stockés avec un niveau de sécurité plus élevé.
|
44
55
|
reset:
|
45
56
|
successful: "Le mot de passe pour '%{email}' a bien été changé."
|
46
|
-
pick_new_password_for: "Choisissez un nouveau mot de passe pour %{email}"
|
57
|
+
pick_new_password_for: "Choisissez un nouveau mot de passe pour %{email}."
|
47
58
|
reset_password: Changer le mot de passe
|
48
|
-
user_mailer:
|
49
|
-
reset_notification:
|
50
|
-
subject: Lien pour changer votre mot de passe
|
51
|
-
reset_request_received_for: "Une demande de changement de mot de passe a été reçue pour %{username}"
|
52
|
-
visit_this_url: Visitez cette URL pour choisir un nouveau mot de passe
|
53
|
-
remain_same_if_no_action: Votre mot de passe restera le même si aucune action n'est choisie
|
54
|
-
roles:
|
55
|
-
superuser: Superuser
|
56
|
-
refinery: Refinery
|
57
59
|
devise:
|
58
60
|
failure:
|
59
|
-
unauthenticated: Vous devez vous connecter ou vous inscrire pour continuer.
|
60
61
|
invalid: Courriel ou mot de passe incorrect.
|
62
|
+
not_found_in_database: Désolé, identifiant ou mot de passe incorrect.
|
63
|
+
unauthenticated: Vous devez vous connecter ou vous inscrire pour continuer.
|
61
64
|
sessions:
|
62
|
-
|
65
|
+
refinery_user:
|
66
|
+
signed_out: Réussite de la déconnexion
|
67
|
+
signed_in: Réussite de la connexion
|
63
68
|
activerecord:
|
64
69
|
models:
|
65
70
|
refinery/authentication/devise/user: utilisateur
|
@@ -67,7 +72,7 @@ fr:
|
|
67
72
|
refinery/authentication/devise/user:
|
68
73
|
login: Nom d'utilisateur
|
69
74
|
username: Nom d'utilisateur
|
70
|
-
email:
|
75
|
+
email: Courriel
|
71
76
|
password: Mot de passe
|
72
77
|
password_confirmation: Confirmer mot de passe
|
73
78
|
remember_me: Se souvenir de moi
|
data/config/locales/nl.yml
CHANGED
data/config/locales/ru.yml
CHANGED
@@ -3,7 +3,7 @@ ru:
|
|
3
3
|
plugins:
|
4
4
|
refinery_authentication_devise:
|
5
5
|
title: Пользователи
|
6
|
-
|
6
|
+
description: Управляйте пользователями
|
7
7
|
authentication:
|
8
8
|
devise:
|
9
9
|
admin:
|
@@ -27,6 +27,12 @@ ru:
|
|
27
27
|
hello_please_sign_in: 'Пожалуйста, войдите.'
|
28
28
|
sign_in: Войти
|
29
29
|
forgot_password: Я забыл свой пароль
|
30
|
+
user_mailer:
|
31
|
+
reset_notification:
|
32
|
+
subject: Ссылка для сброса пароля
|
33
|
+
reset_request_received_for: "Получен запрос на сброс пароля для %{username}"
|
34
|
+
visit_this_url: Для ввода нового пароля пройдите по этой ссылке
|
35
|
+
remain_same_if_no_action: Вы также можете проигнорировать это письмо. В этом случае пароль не будет изменён.
|
30
36
|
users:
|
31
37
|
new:
|
32
38
|
fill_form: Заполните данные ниже.
|
@@ -45,18 +51,20 @@ ru:
|
|
45
51
|
successful: "Пароль успешно изменен для %{email}"
|
46
52
|
pick_new_password_for: "Введите новый пароль для %{email}"
|
47
53
|
reset_password: Изменить пароль
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
remain_same_if_no_action: Вы также можете проигнорировать это письмо. В этом случае пароль не будет изменён.
|
54
|
+
roles:
|
55
|
+
superuser: Суперпользователь
|
56
|
+
refinery: Refinery
|
57
|
+
delete:
|
58
|
+
message: "Вы на самом деле хотите навсегда удалить %{title}?"
|
54
59
|
devise:
|
55
60
|
failure:
|
56
61
|
unauthenticated: "Вам необходимо войти в систему или зарегистрироваться."
|
57
62
|
invalid: "Неверный адрес e-mail или пароль."
|
63
|
+
not_found_in_database: "Извините, имя пользователя и/или пароль неверны."
|
58
64
|
sessions:
|
59
65
|
signed_in: "Вход в систему выполнен."
|
66
|
+
refinery_user:
|
67
|
+
signed_out: Выход из системы выполнен.
|
60
68
|
activerecord:
|
61
69
|
models:
|
62
70
|
refinery/authentication/devise/user: пользователь
|
@@ -64,7 +72,8 @@ ru:
|
|
64
72
|
refinery/authentication/devise/user:
|
65
73
|
login: Имя или почта пользователя
|
66
74
|
username: Имя пользователя
|
67
|
-
email: Эл. почта
|
68
75
|
password: Пароль
|
69
76
|
password_confirmation: Подтверждение пароля
|
77
|
+
email: Эл. почта
|
70
78
|
remember_me: Запомнить меня
|
79
|
+
full_name: Полное имя
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateRefinerycmsAuthenticationSchema < ActiveRecord::Migration
|
1
|
+
class CreateRefinerycmsAuthenticationSchema < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
# Postgres apparently requires the roles_users table to exist before creating the roles table.
|
4
4
|
create_table :refinery_roles_users, :id => false do |t|
|
data/readme.md
CHANGED
@@ -1,15 +1,36 @@
|
|
1
|
-
# Refinery CMS Authentication Extension for Devise
|
1
|
+
# Refinery CMS Authentication Extension for Devise [![Build Status](https://travis-ci.org/refinery/refinerycms-authentication-devise.svg?branch=master)](https://travis-ci.org/refinery/refinerycms-authentication-devise)
|
2
2
|
|
3
|
-
This extension allows you to use Devise with Refinery CMS
|
3
|
+
This extension allows you to use Devise with Refinery CMS 4.0 and later.
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
7
|
Simply put this in the Gemfile of your Refinery application:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'refinerycms-authentication-devise', '~>
|
10
|
+
gem 'refinerycms-authentication-devise', '~> 2.0.0'
|
11
11
|
```
|
12
12
|
|
13
|
+
Then run `bundle install` to install it.
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
If you're moving from a pre-3.0 release of Refinery, you lost authentication when it moved out of RefineryCMS core. After installing this gem, follow these steps to migrate old user data and re-enable authentication.
|
18
|
+
|
19
|
+
### Generate and run migrations
|
20
|
+
|
21
|
+
```sh
|
22
|
+
rails g refinery:authentication:devise # Generate migrations
|
23
|
+
rake db:migrate # Run migrations
|
24
|
+
```
|
25
|
+
|
26
|
+
### Set up your new initializer
|
27
|
+
|
28
|
+
You might have old data in `initializers/refinery/authentication.rb`. The new initializer is located in `initializers/refinery/authentication/devise.rb`.
|
29
|
+
|
30
|
+
Make sure `devise.rb` is configured correctly, then delete `authentication.rb`.
|
31
|
+
|
32
|
+
Then restart your server.
|
33
|
+
|
13
34
|
## Contributing
|
14
35
|
|
15
36
|
Please see the [contributing.md](contributing.md) file for instructions.
|
@@ -2,21 +2,21 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = %q{refinerycms-authentication-devise}
|
5
|
-
s.version = %q{
|
5
|
+
s.version = %q{2.0.0}
|
6
6
|
s.summary = %q{Devise based authentication extension for Refinery CMS}
|
7
7
|
s.description = %q{A Devise authentication extension for Refinery CMS}
|
8
8
|
s.homepage = %q{http://refinerycms.com}
|
9
|
-
s.authors = ['Philip Arndt', 'Rob Yurkowski']
|
9
|
+
s.authors = ['Philip Arndt', 'Brice Sanchez', 'Rob Yurkowski']
|
10
10
|
s.license = %q{MIT}
|
11
11
|
s.require_paths = %w(lib)
|
12
12
|
|
13
13
|
s.files = `git ls-files`.split("\n")
|
14
14
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
15
15
|
|
16
|
-
s.add_dependency 'refinerycms-core', ['
|
17
|
-
s.add_dependency 'actionmailer', ['
|
18
|
-
s.add_dependency 'devise', ['~>
|
19
|
-
s.add_dependency 'friendly_id', '~> 5.1
|
16
|
+
s.add_dependency 'refinerycms-core', ['>= 3.0.0', '< 5.0']
|
17
|
+
s.add_dependency 'actionmailer', ['>= 5.0.0', '< 5.2']
|
18
|
+
s.add_dependency 'devise', ['~> 4.0', '>= 4.3.0']
|
19
|
+
s.add_dependency 'friendly_id', '~> 5.2.1'
|
20
20
|
|
21
|
-
s.required_ruby_version = '>= 2.
|
21
|
+
s.required_ruby_version = '>= 2.2.2'
|
22
22
|
end
|
@@ -34,7 +34,7 @@ describe Refinery::Authentication::Devise::Admin::UsersController, :type => :con
|
|
34
34
|
user = Refinery::Authentication::Devise::User.new :username => "bob"
|
35
35
|
expect(user).to receive(:save).once{ true }
|
36
36
|
expect(Refinery::Authentication::Devise::User).to receive(:new).once.with(instance_of(ActionController::Parameters)){ user }
|
37
|
-
post :create, :user
|
37
|
+
post :create, params: { user: { username: 'bobby' } }
|
38
38
|
expect(response).to be_redirect
|
39
39
|
end
|
40
40
|
|
@@ -44,7 +44,7 @@ describe Refinery::Authentication::Devise::Admin::UsersController, :type => :con
|
|
44
44
|
user = Refinery::Authentication::Devise::User.new :username => "bob"
|
45
45
|
expect(user).to receive(:save).once{ false }
|
46
46
|
expect(Refinery::Authentication::Devise::User).to receive(:new).once.with(instance_of(ActionController::Parameters)){ user }
|
47
|
-
post :create, :user
|
47
|
+
post :create, params: { user: { username: 'bobby' } }
|
48
48
|
expect(response).to be_success
|
49
49
|
expect(response).to render_template("refinery/authentication/devise/admin/users/new")
|
50
50
|
end
|
@@ -54,7 +54,7 @@ describe Refinery::Authentication::Devise::Admin::UsersController, :type => :con
|
|
54
54
|
refinery_login_with_devise [:refinery, :superuser]
|
55
55
|
|
56
56
|
it "renders the edit template" do
|
57
|
-
get :edit, :id
|
57
|
+
get :edit, params: { id: logged_in_user.id }
|
58
58
|
expect(response).to be_success
|
59
59
|
expect(response).to render_template("refinery/authentication/devise/admin/users/edit")
|
60
60
|
end
|
@@ -67,13 +67,13 @@ describe Refinery::Authentication::Devise::Admin::UsersController, :type => :con
|
|
67
67
|
|
68
68
|
let(:additional_user) { FactoryGirl.create :authentication_devise_refinery_user }
|
69
69
|
it "updates a user" do
|
70
|
-
patch
|
70
|
+
patch :update, params: { id: additional_user.id.to_s, user: { username: 'bobby' } }
|
71
71
|
expect(response).to be_redirect
|
72
72
|
end
|
73
73
|
|
74
74
|
context "when specifying plugins" do
|
75
75
|
it "won't allow to remove 'Users' plugin from self" do
|
76
|
-
patch
|
76
|
+
patch :update, params: { id: logged_in_user.id.to_s, user: { plugins: ["some plugin"] } }
|
77
77
|
|
78
78
|
expect(flash[:error]).to eq("You cannot remove the 'Users' plugin from the currently logged in account.")
|
79
79
|
end
|
@@ -81,7 +81,7 @@ describe Refinery::Authentication::Devise::Admin::UsersController, :type => :con
|
|
81
81
|
it "will update to the plugins supplied" do
|
82
82
|
expect(logged_in_user).to receive(:update_attributes).with({"plugins" => %w(refinery_authentication_devise some_plugin)})
|
83
83
|
allow(Refinery::Authentication::Devise::User).to receive_message_chain(:includes, :find) { logged_in_user }
|
84
|
-
patch
|
84
|
+
patch :update, params: { id: logged_in_user.id.to_s, user: { plugins: %w(refinery_authentication_devise some_plugin) } }
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -13,6 +13,9 @@ describe "password recovery", :type => :feature do
|
|
13
13
|
it "shows success message" do
|
14
14
|
visit refinery.new_authentication_devise_user_password_path
|
15
15
|
fill_in "authentication_devise_user_email", :with => user.email
|
16
|
+
expect(Refinery::Authentication::Devise::UserMailer)
|
17
|
+
.to receive(:reset_notification)
|
18
|
+
.and_return(double(deliver_now: true, deliver_later: true))
|
16
19
|
click_button "Reset password"
|
17
20
|
expect(page).to have_content("An email has been sent to you with a link to reset your password.")
|
18
21
|
end
|
metadata
CHANGED
@@ -1,90 +1,91 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-authentication-devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Arndt
|
8
|
+
- Brice Sanchez
|
8
9
|
- Rob Yurkowski
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: refinerycms-core
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
17
18
|
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '3.0'
|
21
19
|
- - ">="
|
22
20
|
- !ruby/object:Gem::Version
|
23
21
|
version: 3.0.0
|
22
|
+
- - "<"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '5.0'
|
24
25
|
type: :runtime
|
25
26
|
prerelease: false
|
26
27
|
version_requirements: !ruby/object:Gem::Requirement
|
27
28
|
requirements:
|
28
|
-
- - "~>"
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '3.0'
|
31
29
|
- - ">="
|
32
30
|
- !ruby/object:Gem::Version
|
33
31
|
version: 3.0.0
|
32
|
+
- - "<"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '5.0'
|
34
35
|
- !ruby/object:Gem::Dependency
|
35
36
|
name: actionmailer
|
36
37
|
requirement: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '4.2'
|
41
39
|
- - ">="
|
42
40
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
41
|
+
version: 5.0.0
|
42
|
+
- - "<"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '5.2'
|
44
45
|
type: :runtime
|
45
46
|
prerelease: false
|
46
47
|
version_requirements: !ruby/object:Gem::Requirement
|
47
48
|
requirements:
|
48
|
-
- - "~>"
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '4.2'
|
51
49
|
- - ">="
|
52
50
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
51
|
+
version: 5.0.0
|
52
|
+
- - "<"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.2'
|
54
55
|
- !ruby/object:Gem::Dependency
|
55
56
|
name: devise
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
57
58
|
requirements:
|
58
59
|
- - "~>"
|
59
60
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
61
|
+
version: '4.0'
|
61
62
|
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.
|
64
|
+
version: 4.3.0
|
64
65
|
type: :runtime
|
65
66
|
prerelease: false
|
66
67
|
version_requirements: !ruby/object:Gem::Requirement
|
67
68
|
requirements:
|
68
69
|
- - "~>"
|
69
70
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
71
|
+
version: '4.0'
|
71
72
|
- - ">="
|
72
73
|
- !ruby/object:Gem::Version
|
73
|
-
version: 3.
|
74
|
+
version: 4.3.0
|
74
75
|
- !ruby/object:Gem::Dependency
|
75
76
|
name: friendly_id
|
76
77
|
requirement: !ruby/object:Gem::Requirement
|
77
78
|
requirements:
|
78
79
|
- - "~>"
|
79
80
|
- !ruby/object:Gem::Version
|
80
|
-
version: 5.1
|
81
|
+
version: 5.2.1
|
81
82
|
type: :runtime
|
82
83
|
prerelease: false
|
83
84
|
version_requirements: !ruby/object:Gem::Requirement
|
84
85
|
requirements:
|
85
86
|
- - "~>"
|
86
87
|
- !ruby/object:Gem::Version
|
87
|
-
version: 5.1
|
88
|
+
version: 5.2.1
|
88
89
|
description: A Devise authentication extension for Refinery CMS
|
89
90
|
email:
|
90
91
|
executables: []
|
@@ -201,7 +202,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
202
|
requirements:
|
202
203
|
- - ">="
|
203
204
|
- !ruby/object:Gem::Version
|
204
|
-
version: 2.
|
205
|
+
version: 2.2.2
|
205
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
207
|
requirements:
|
207
208
|
- - ">="
|
@@ -209,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
210
|
version: '0'
|
210
211
|
requirements: []
|
211
212
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.6.13
|
213
214
|
signing_key:
|
214
215
|
specification_version: 4
|
215
216
|
summary: Devise based authentication extension for Refinery CMS
|
@@ -224,4 +225,3 @@ test_files:
|
|
224
225
|
- spec/spec_helper.rb
|
225
226
|
- spec/support/refinery/authentication/devise/controller_macros.rb
|
226
227
|
- spec/support/refinery/authentication/devise/feature_macros.rb
|
227
|
-
has_rdoc:
|