diff --git a/spec/javascripts/app/app_spec.js b/spec/javascripts/app/app_spec.js index f85054293..6989301f4 100644 --- a/spec/javascripts/app/app_spec.js +++ b/spec/javascripts/app/app_spec.js @@ -3,13 +3,6 @@ describe("app", 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; @@ -17,4 +10,13 @@ describe("app", function() { expect(app.user()).toEqual(false); }); }); + + describe('currentUser', function(){ + it("sets the user if given one and returns the current user", function() { + expect(app.currentUser.authenticated()).toBeFalsy() + app.user({name: "alice"}); + + expect(app.user().get("name")).toEqual("alice"); + }); + }); }); diff --git a/spec/javascripts/app/views/stream_faces_view_spec.js b/spec/javascripts/app/views/stream_faces_view_spec.js index 8cdf4eb6c..31cbd0eeb 100644 --- a/spec/javascripts/app/views/stream_faces_view_spec.js +++ b/spec/javascripts/app/views/stream_faces_view_spec.js @@ -43,7 +43,7 @@ describe("app.views.StreamFaces", function(){ it("rerenders when people are added, but caps to 15 people", function(){ var posts = _.map(_.range(20), function(){ return factory.post()}) this.posts.reset(posts) //add 20 posts silently to the collection - this.posts.add(factory.post) //trigger an update + this.posts.add(factory.post()) //trigger an update expect(this.view.$("img").length).toBe(15) }) }) diff --git a/spec/javascripts/helpers/factory.js b/spec/javascripts/helpers/factory.js index c5c0520cd..03be9097c 100644 --- a/spec/javascripts/helpers/factory.js +++ b/spec/javascripts/helpers/factory.js @@ -52,6 +52,7 @@ factory = { var defaultAttrs = { "provider_display_name" : null, "created_at" : "2012-01-03T19:53:13Z", + "interacted_at" : '2012-01-03T19:53:13Z', "last_three_comments" : null, "public" : false, "guid" : this.guid(), diff --git a/spec/javascripts/search-spec.js b/spec/javascripts/search-spec.js index 7a6f9751f..062d12814 100644 --- a/spec/javascripts/search-spec.js +++ b/spec/javascripts/search-spec.js @@ -6,8 +6,6 @@ describe("List", function() { describe("runDelayedSearch", function() { - beforeEach( function(){ - }); it('gets called on initialize', function(){ spyOn( List, 'startSearchDelay'); @@ -23,9 +21,8 @@ describe("List", function() { }); it('inserts contact html', function(){ - List.handleSearchRefresh( { count:1,search_html: '
hello
' } ); + List.handleSearchRefresh( { count:1, search_html: "
hello
" } ); expect($(".testing_insert_div").text().toEqual( "hello" )); - }); }); });