devise_invitable 2.0.7 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of devise_invitable might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2a7d1c4ae3cc61e2992fa9920ddd35e6626745dd32333a88e8231fb267e2cb0
4
- data.tar.gz: ee68fbb505a629c391934bee8c644c0ade499333d5c7065745426fd6e419642a
3
+ metadata.gz: 1d79a9c9139872616687b6479929d53572f9634188eeb9a83a7fdb56c9a56de0
4
+ data.tar.gz: dd37eafdb0b8a074c11ab51c25b8faea114992cf640e599edb5b9fefec0eb9a3
5
5
  SHA512:
6
- metadata.gz: fd3ead62e8c2246f9246fbac3a2138ea6ff4f1abcf3c577faad920b339f1c1795b54497d03b34f4bc685be6131f62692d2497fbc5d1081e740e0a85d7e1a25c2
7
- data.tar.gz: 0453554d47731a99e931c81dbd44e77eca935ff6ca453172f40f394da84bd1d5a92507aafa881ab491202cee5fa534aef4ba9b2a4ac1fa37327a664c7ceb8e61
6
+ metadata.gz: a275438d6791f2f3e06d3d7a0b83db15142ce0a24337f928e08ee7c9818aa517efaa070c73e2bfc280a28ef8cf1104a9aa6711c8325479c02a794a1b963ec9d5
7
+ data.tar.gz: cef6663d0ce1f61b87dcc73cf151afa55a4054983c8a580d2a94446887f5018a5ba604eea0a656495e2ae3755bc437457c1d109d1ae8faf775182417c4ca313f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.8
2
+ - Fix for turbo stream
3
+
4
+ ## 2.0.7
1
5
  - Allow customizing invalid_token_path_for, the path to redirect users who try to accept with invalid token
2
6
  - Don't override registrations controller in routes if module option is used
3
7
  - Fix typo in spanish translation, add Catalan translation ([#857](https://github.com/scambra/devise_invitable/pull/857))
data/README.rdoc CHANGED
@@ -341,7 +341,7 @@ To accept an invitation with a token use the <tt>accept_invitation!</tt> class m
341
341
  === Callbacks
342
342
 
343
343
  A callback event is fired before and after an invitation is created (User#invite!) or accepted (User#accept_invitation!). For example, in your resource model you can add:
344
-
344
+ # Note: callbacks should be placed after devise: :invitable is specified.
345
345
  before_invitation_created :email_admins
346
346
  after_invitation_accepted :email_invited_by
347
347
 
@@ -31,7 +31,7 @@ class Devise::InvitationsController < DeviseController
31
31
  respond_with resource, location: after_invite_path_for(current_inviter, resource)
32
32
  end
33
33
  else
34
- respond_with_navigational(resource) { render :new, status: :unprocessable_entity }
34
+ respond_with(resource)
35
35
  end
36
36
  end
37
37
 
@@ -63,7 +63,7 @@ class Devise::InvitationsController < DeviseController
63
63
  end
64
64
  else
65
65
  resource.invitation_token = raw_invitation_token
66
- respond_with_navigational(resource) { render :edit, status: :unprocessable_entity }
66
+ respond_with(resource)
67
67
  end
68
68
  end
69
69
 
@@ -1,3 +1,3 @@
1
1
  module DeviseInvitable
2
- VERSION = '2.0.7'.freeze
2
+ VERSION = '2.0.8'.freeze
3
3
  end
@@ -98,7 +98,7 @@ class InvitationTest < ActionDispatch::IntegrationTest
98
98
  fill_in 'Password confirmation', with: 'other_password'
99
99
  end
100
100
  assert_equal user_invitation_path, current_path
101
- assert page.has_css?('#error_explanation li', text: /Password .*doesn\'t match/)
101
+ assert page.has_css?('#error_explanation li', text: /Password .*doesn['’]t match/)
102
102
  assert !user.confirmed?
103
103
  end
104
104
 
@@ -371,10 +371,10 @@ class InvitableTest < ActiveSupport::TestCase
371
371
  existing_user.save(validate: false)
372
372
  user = User.invite!(email: 'valid@email.com')
373
373
  assert_equal user, existing_user
374
- assert_equal ['has already been taken'], user.errors[:email]
374
+ assert_equal [{error: :taken}], user.errors.details[:email]
375
375
  same_user = User.invite!(email: 'valid@email.com')
376
376
  assert_equal same_user, existing_user
377
- assert_equal ['has already been taken'], same_user.errors[:email]
377
+ assert_equal [{error: :taken}], same_user.errors.details[:email]
378
378
  end
379
379
 
380
380
  test 'should return a record with errors if user with pending invitation was found by e-mail' do
@@ -388,7 +388,7 @@ class InvitableTest < ActiveSupport::TestCase
388
388
 
389
389
  user = User.invite!(email: 'valid@email.com')
390
390
  assert_equal user, existing_user
391
- assert_equal ['has already been taken'], user.errors[:email]
391
+ assert_equal [{error: :taken}], user.errors.details[:email]
392
392
  ensure
393
393
  User.resend_invitation = resend_invitation
394
394
  end
@@ -402,7 +402,7 @@ class InvitableTest < ActiveSupport::TestCase
402
402
  existing_user.save(validate: false)
403
403
  user = User.invite!(email: 'valid@email.com', username: 'a' * 50)
404
404
  assert_equal user, existing_user
405
- assert_equal ['has already been taken'], user.errors[:email]
405
+ assert_equal [{error: :taken}], user.errors.details[:email]
406
406
  refute_empty user.errors[:username]
407
407
  ensure
408
408
  User.validate_on_invite = validate_on_invite
@@ -412,13 +412,13 @@ class InvitableTest < ActiveSupport::TestCase
412
412
  test 'should return a new record with errors if e-mail is blank' do
413
413
  invited_user = User.invite!(email: '')
414
414
  assert invited_user.new_record?
415
- assert_equal ["can't be blank"], invited_user.errors[:email]
415
+ assert_equal [{error: :blank}], invited_user.errors.details[:email]
416
416
  end
417
417
 
418
418
  test 'should return a new record with errors if e-mail is invalid' do
419
419
  invited_user = User.invite!(email: 'invalid_email')
420
420
  assert invited_user.new_record?
421
- assert_equal ['is invalid'], invited_user.errors[:email]
421
+ assert_equal [{error: :invalid}], invited_user.errors.details[:email]
422
422
  end
423
423
 
424
424
  test 'should set all attributes with errors if e-mail is invalid' do
@@ -438,13 +438,13 @@ class InvitableTest < ActiveSupport::TestCase
438
438
  test 'should return a new record with errors if no invitation_token is found' do
439
439
  invited_user = User.accept_invitation!(invitation_token: 'invalid_token')
440
440
  assert invited_user.new_record?
441
- assert_equal ['is invalid'], invited_user.errors[:invitation_token]
441
+ assert_equal [{error: :invalid}], invited_user.errors.details[:invitation_token]
442
442
  end
443
443
 
444
444
  test 'should return a new record with errors if invitation_token is blank' do
445
445
  invited_user = User.accept_invitation!(invitation_token: '')
446
446
  assert invited_user.new_record?
447
- assert_equal ["can't be blank"], invited_user.errors[:invitation_token]
447
+ assert_equal [{error: :blank}], invited_user.errors.details[:invitation_token]
448
448
  end
449
449
 
450
450
  test 'should return record with errors if invitation_token has expired' do
@@ -454,7 +454,7 @@ class InvitableTest < ActiveSupport::TestCase
454
454
  invited_user.save(validate: false)
455
455
  user = User.accept_invitation!(invitation_token: Thread.current[:token])
456
456
  assert_equal user, invited_user
457
- assert_equal ['is invalid'], user.errors[:invitation_token]
457
+ assert_equal [{error: :invalid}], user.errors.details[:invitation_token]
458
458
  end
459
459
 
460
460
  test 'should allow record modification using block' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_invitable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-09 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer