summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Miller <gavmille@cisco.com>2016-08-17 09:05:51 -0600
committerGavin Miller <gavmille@cisco.com>2016-08-17 09:07:14 -0600
commit1be1d6878f4aba93cbd00372b36e00e3ff97f7e8 (patch)
tree86465db93952f1801273704044d84969697af29b
parentd5395b6194e1218ea3bddf471fb903261d439bac (diff)
Added spec for getting all totp's out at once
-rw-r--r--spec/lib/cli_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/cli_spec.rb b/spec/lib/cli_spec.rb
index 52f1a42..f4b570e 100644
--- a/spec/lib/cli_spec.rb
+++ b/spec/lib/cli_spec.rb
@@ -33,6 +33,20 @@ module TFA
expect(subject.totp("development")).to eql(code_for(secret))
end
end
+
+ context "when no key is given" do
+ it "returns a time based one time password for all keys" do
+ secret1 = secret
+ secret2 = ::ROTP::Base32.random_base32
+
+ subject.add("development", secret1)
+ subject.add("production", secret2)
+
+ result = subject.totp.to_s
+ expect(result).to include(code_for(secret1))
+ expect(result).to include(code_for(secret2))
+ end
+ end
end
end
end