summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/srp/spec/account_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/srp/spec/account_spec.js')
-rw-r--r--app/assets/javascripts/srp/spec/account_spec.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/assets/javascripts/srp/spec/account_spec.js b/app/assets/javascripts/srp/spec/account_spec.js
new file mode 100644
index 0000000..4110778
--- /dev/null
+++ b/app/assets/javascripts/srp/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");
+ });
+
+ });
+});