summaryrefslogtreecommitdiff
path: root/spec/account_spec.js
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-06-22 16:17:45 +0200
committerAzul <azul@riseup.net>2013-06-24 12:33:03 +0200
commit0c5369fd9299eb9bf7295e3925ce803c5473e2b8 (patch)
tree14a591408caecc369b84d985dae1864019f3aedc /spec/account_spec.js
parentf1ad0b7e428205a76f6176f44100eac39bb80310 (diff)
refactor: separate account from session
Diffstat (limited to 'spec/account_spec.js')
-rw-r--r--spec/account_spec.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/account_spec.js b/spec/account_spec.js
new file mode 100644
index 0000000..4110778
--- /dev/null
+++ b/spec/account_spec.js
@@ -0,0 +1,31 @@
+describe("Account", function() {
+ describe("without seeded values", function(){
+ beforeEach(function() {
+ account = new srp.Account();
+ });
+
+ it("fetches the password from the password field", function(){
+ expect(account.password()).toBe("password");
+ });
+
+ it("fetches the login from the login field", function(){
+ expect(account.login()).toBe("testuser");
+ });
+
+ });
+
+ describe("with seeded values", function(){
+ beforeEach(function() {
+ account = new srp.Account("login", "secret");
+ });
+
+ it("uses the seeded password", function(){
+ expect(account.password()).toBe("secret");
+ });
+
+ it("uses the seeded login", function(){
+ expect(account.login()).toBe("login");
+ });
+
+ });
+});