-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,4 +85,19 @@ class User::BootstrapTest < ActiveSupport::TestCase | |
refute user.reload.bootcamp_attendee? | ||
assert_equal user.id, ubd.reload.user_id | ||
end | ||
|
||
test "finds paid bootcamp data first" do | ||
email = "[email protected]" | ||
create(:user_bootcamp_data, email:) | ||
ubd = create :user_bootcamp_data, email:, paid_at: Time.current | ||
create(:user_bootcamp_data, email:) | ||
user = create(:user, email:) | ||
|
||
# Always does this once by default anyway | ||
User::Bootcamp::SubscribeToOnboardingEmails.expects(:defer).with(ubd).twice | ||
|
||
User::Bootstrap.(user, bootcamp_access_code: ubd.access_code) | ||
assert user.reload.bootcamp_attendee? | ||
assert_equal user.id, ubd.reload.user_id | ||
end | ||
end |