-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Configurable token randomness * Add changelog entry for pull #67 * Update config call in generate_random_token and move randomness config to general section
- Loading branch information
Showing
5 changed files
with
41 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'spec_helper' | ||
|
||
describe Sorcery::Model::TemporaryToken do | ||
describe '.generate_random_token' do | ||
before do | ||
sorcery_reload! | ||
end | ||
|
||
subject { Sorcery::Model::TemporaryToken.generate_random_token.length } | ||
|
||
context 'token_randomness is 3' do | ||
before do | ||
sorcery_model_property_set(:token_randomness, 3) | ||
end | ||
|
||
it { is_expected.to eq 4 } | ||
end | ||
|
||
context 'token_randomness is 15' do | ||
before do | ||
sorcery_model_property_set(:token_randomness, 15) | ||
end | ||
|
||
it { is_expected.to eq 20 } | ||
end | ||
end | ||
end |