-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refresh
rails_account
when account
changed
This ensures `rails_account` will always match the assigned `account`, making sure that features such as what rodauth-become_account provides will work. See adam12/rodauth-become_account#3.
- Loading branch information
Showing
3 changed files
with
9 additions
and
2 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
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 |
---|---|---|
|
@@ -90,7 +90,7 @@ class RodauthTest < UnitTest | |
assert_equal :login_required, error.reason | ||
end | ||
|
||
test "returns current account if logged in" do | ||
test "allows retrieving current account model instance" do | ||
assert_nil Rodauth::Rails.rodauth.rails_account | ||
|
||
account = Account.create!(email: "[email protected]", status: "verified") | ||
|
@@ -99,6 +99,10 @@ class RodauthTest < UnitTest | |
rodauth = RodauthApp.rodauth.allocate | ||
rodauth.instance_eval { @account = account_ds(account.id).first! } | ||
assert_equal account, rodauth.rails_account | ||
|
||
account2 = Account.create!(email: "[email protected]", status: "verified") | ||
rodauth.instance_eval { @account = account_ds(account2.id).first! } | ||
assert_equal account2, rodauth.rails_account | ||
end | ||
|
||
test "allows using as a library" do | ||
|