diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-10-31 17:36:13 +0000 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2018-10-31 17:36:13 +0000 |
commit | 965b561d3913b9452665da69c020d1b5a4513fbe (patch) | |
tree | a566ad66ea643bd4ce1914cbb790d087401616f4 | |
parent | 8d5a757f1d134498e97670dc7ecab42c13904ae3 (diff) | |
download | gitlab-ce-jej/token-authenticable-changes-for-saml.tar.gz |
WIP: tests for TokenAuthenticatable unique:falsejej/token-authenticable-changes-for-saml
-rw-r--r-- | spec/models/concerns/token_authenticatable_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/concerns/token_authenticatable_spec.rb b/spec/models/concerns/token_authenticatable_spec.rb index 782687516ae..1a2df34bfcd 100644 --- a/spec/models/concerns/token_authenticatable_spec.rb +++ b/spec/models/concerns/token_authenticatable_spec.rb @@ -30,6 +30,19 @@ describe ApplicationSetting, 'TokenAuthenticatable' do it { is_expected.not_to be_blank } end + # describe 'for non-unique token' do + # subject { described_class.new.send(token_field, unique: false) } + + # it 'avoids database lookup of existing tokens' do + # expect_any_instance_of(activerecord).not_to receive(:find_by) + # do-stuff + # + # queries = ActiveRecord::QueryRecorder.new { do_stuff } + # expect(queries.log_message).not_to include("SELECT") + # expect(queries.count).to eq 1 + # end + # end + describe 'ensured token' do subject { described_class.new.send("ensure_#{token_field}") } |