summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/srp/spec/account_spec.js
blob: 4110778f715d1cf5cc2ed436bc3f8991eaf13825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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");
    });

  });
});