File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def perform(user_id)
6
6
user = User . find ( user_id )
7
7
return if user . active?
8
8
9
- RefreshUserJob . new . perform ( user . username )
9
+ RefreshUserJob . new . perform ( user . id )
10
10
NotifierMailer . welcome_email ( user . username ) . deliver
11
11
12
12
user . activate!
Original file line number Diff line number Diff line change 22
22
expect ( user . active? ) . to eq ( true )
23
23
expect ( user . activated_on ) . not_to eq ( nil )
24
24
end
25
+
26
+ it "should send welcome mail" do
27
+ mail = double ( "mail" )
28
+ expect ( NotifierMailer ) . to receive ( :welcome_email ) . with ( user . username ) . and_return ( mail )
29
+ expect ( mail ) . to receive ( :deliver )
30
+ worker . perform ( user . id )
31
+ end
32
+
33
+ it "should create refresh job" do
34
+ expect_any_instance_of ( RefreshUserJob ) . to receive ( :perform ) . with ( user . id )
35
+ worker . perform ( user . id )
36
+ end
37
+
25
38
end
26
39
27
40
context 'when activate user' do
You can’t perform that action at this time.
0 commit comments