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-22 16:17:45 +0200
commit21c3134a868efa4104bb87a2a8fc36f485e163bb (patch)
tree14a591408caecc369b84d985dae1864019f3aedc /spec/account_spec.js
parent16602079b3cd92ad85f3d4afe57763c029b67ae8 (diff)
refactor: separate account from sessionrefactor/separate-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");
+ });
+
+ });
+});