 
     expect(currentUser).toEqual defaultAnonymousUser
     httpBackend.expectPOST(authenticationUrl).respond(signInResponse)
-    auth.signIn authenticationUrl, { email: "user@localhost", password: "abc123" }
+    auth.signIn authenticationUrl, { username: "user@localhost", password: "abc123" }
     httpBackend.flush()
     expect(currentUser).toEqual defaultAnonymousUser # user should not change
 
   it "should authorise user roles correctly", ->
-    roleWhitelist = [ "basic", "admin" ]
+    roleWhitelist = [ "Student", "Admin" ]
     expect(auth.isAuthorised(roleWhitelist, "anon")).toBe(false)
-    expect(auth.isAuthorised(roleWhitelist, "basic")).toBe(true)
-    expect(auth.isAuthorised(roleWhitelist, "admin")).toBe(true)
+    expect(auth.isAuthorised(roleWhitelist, "Student")).toBe(true)
+    expect(auth.isAuthorised(roleWhitelist, "Admin")).toBe(true)
 
-    roleWhitelist = [ "admin" ]
+    roleWhitelist = [ "Admin" ]
     expect(auth.isAuthorised(roleWhitelist, "anon")).toBe(false)
-    expect(auth.isAuthorised(roleWhitelist, "basic")).toBe(false)
-    expect(auth.isAuthorised(roleWhitelist, "admin")).toBe(true)
+    expect(auth.isAuthorised(roleWhitelist, "Student")).toBe(false)
+    expect(auth.isAuthorised(roleWhitelist, "Admin")).toBe(true)
 
     # An empty whitelist should not authorise anyone.
     roleWhitelist = []
     expect(auth.isAuthorised(roleWhitelist, "anon")).toBe(false)
-    expect(auth.isAuthorised(roleWhitelist, "basic")).toBe(false)
-    expect(auth.isAuthorised(roleWhitelist, "admin")).toBe(false)
+    expect(auth.isAuthorised(roleWhitelist, "Student")).toBe(false)
+    expect(auth.isAuthorised(roleWhitelist, "Admin")).toBe(false)
 
     # If no whitelist is specified, anyone should be authorised.
     roleWhitelist = undefined
     expect(auth.isAuthorised(roleWhitelist, "anon")).toBe(true)
-    expect(auth.isAuthorised(roleWhitelist, "basic")).toBe(true)
-    expect(auth.isAuthorised(roleWhitelist, "admin")).toBe(true)
+    expect(auth.isAuthorised(roleWhitelist, "Student")).toBe(true)
+    expect(auth.isAuthorised(roleWhitelist, "Admin")).toBe(true)
 
   it "should automatically intercept unauthorised API responses", ->
     intercepted = false

    rootScope = _$rootScope_

  it "should change user when signing in and out", ->
    userCredentials = { email: "user@localhost", password: "abc123" }

    signInResponse =
      success: true
      auth_token: "a_fake_token"
      user:
        id: 1
        system_role: "admin"
        first_name: "Test"
        last_name: "User"
        nickname: "anon"

      auth_token: "a_fake_token"
      user:
        id: 1
        system_role: "Admin"
        first_name: "Test"
        last_name: "User"
        nickname: "anon"

    httpBackend.expectPOST(authenticationUrl).respond(signInResponse)
    auth.signIn authenticationUrl, { username: "user", password: "abc123" }
    httpBackend.flush()

    # After sign in: the current user's auth token should be present in API request params.
