diaspora/spec/javascripts/app/app_spec.js
2012-03-03 12:20:31 -05:00

20 lines
576 B
JavaScript

describe("app", function() {
describe("user", function() {
it("sets the user if given one and returns the current user", function() {
expect(app.user()).toBeFalsy()
});
it("sets the user if given one and returns the current user", function() {
expect(app.user().authenticated()).toBeFalsy()
app.user({name: "alice"});
expect(app.user().get("name")).toEqual("alice");
});
it("returns false if the current_user isn't set", function() {
app._user = undefined;
expect(app.user()).toEqual(false);
});
});
});