File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
app/lib/warden_extensions Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def configure_manager
22
22
case auth . winning_strategy &.key
23
23
when :magic_session
24
24
user . confirm!
25
+ WelcomeNotifier . deliver_to ( user )
25
26
when :password
26
27
# no op
27
28
else # nil, as with test helpers
Original file line number Diff line number Diff line change 49
49
expect ( user . reload . last_sign_in_at ) . to be_present
50
50
end
51
51
52
- it "signs in unconfirmed user with valid magic session token" do
52
+ it "signs in and confirms unconfirmed user with valid magic session token" do
53
53
user = FactoryBot . create ( :user , :unconfirmed )
54
54
token = user . generate_token_for ( :magic_session )
55
55
expect ( user . last_sign_in_at ) . to be_nil
65
65
66
66
expect ( user . last_sign_in_at ) . to be_present
67
67
expect ( user ) . to be_confirmed
68
+
69
+ perform_enqueued_jobs_and_subsequently_enqueued_jobs
70
+
71
+ expect ( ActionMailer ::Base . deliveries . count ) . to eq ( 1 )
72
+
73
+ mail = find_mail_to ( user . email )
74
+ expect ( mail . subject ) . to eq ( "Welcome to Joy of Rails!" )
68
75
end
69
76
70
77
it "disallows when user not found with given email" do
You can’t perform that action at this time.
0 commit comments