diff options
author | Raphael Sofaer <raphael@joindiaspora.com> | 2011-07-12 01:38:51 +0400 |
---|---|---|
committer | Raphael Sofaer <raphael@joindiaspora.com> | 2011-07-12 01:38:51 +0400 |
commit | e59f49aace4a6e4ad695c5791768a4470be67c49 (patch) | |
tree | d24e7ef5ad07ec138475f5045d549cb793a349d7 /spec | |
parent | eafe6a7c8541c8fceaaa789d3907c7862f0161e9 (diff) |
Fix specs after merge
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/aspects_controller_spec.rb | 6 | ||||
-rw-r--r-- | spec/javascripts/stream-spec.js | 20 | ||||
-rw-r--r-- | spec/lib/fake_spec.rb | 6 |
3 files changed, 14 insertions, 18 deletions
diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index f74b8f18b..792ac7a9e 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -65,7 +65,7 @@ describe AspectsController do it 'generates a jasmine fixture with posts', :fixture => true do message = alice.post(:status_message, :text => "hello "*800, :to => @alices_aspect_2.id) - 4.times { bob.comment("what", :post => message) } + 3.times { bob.comment("what", :post => message) } get :index save_fixture(html_for("body"), "aspects_index_with_posts") @@ -90,13 +90,13 @@ describe AspectsController do response.should_not be_redirect end end - + context 'with no aspects' do before do alice.aspects.each { |aspect| aspect.destroy } alice.reload end - + it 'redirects to the new aspect page' do get :index response.should redirect_to new_aspect_path diff --git a/spec/javascripts/stream-spec.js b/spec/javascripts/stream-spec.js index b161bac1c..a4576f0bd 100644 --- a/spec/javascripts/stream-spec.js +++ b/spec/javascripts/stream-spec.js @@ -12,10 +12,10 @@ describe("Stream", function() { describe("setUpLives", function() { - it("attaches a click event to show_post_comments links", function() { + it("attaches a click event to toggle_post_comments links", function() { spyOn(Stream, "toggleComments"); Stream.initializeLives(); - $('.stream a.show_post_comments').click(); + $('.stream a.toggle_post_comments').click(); expect(Stream.toggleComments).toHaveBeenCalled(); }); @@ -37,26 +37,26 @@ describe("Stream", function() { }); describe("toggleComments", function() { - it("toggles class hidden on the comment block", function () { - link = $("a.show_post_comments"); - expect(jQuery('ul.comments .older_comments')).toHaveClass("hidden"); + it("toggles class hidden on the comments ul", function () { + link = $("a.toggle_post_comments"); + expect(jQuery('ul.comments')).not.toHaveClass("hidden"); Stream.toggleComments.call( link, {preventDefault: function(){} } ); jasmine.Clock.tick(200); - expect(jQuery('ul.comments .older_comments')).not.toHaveClass("hidden"); + expect(jQuery('ul.comments')).toHaveClass("hidden"); }); it("changes the text on the show comments link", function() { - link = $("a.show_post_comments"); + link = $("a.toggle_post_comments"); Diaspora.widgets.i18n.loadLocale( - {'comments' : {'hide': 'comments.hide pl'}}, 'en'); - expect(link.text()).toEqual("Show 1 more comments"); + {'comments' : {'show': 'comments.show pl'}}, 'en'); + expect(link.text()).toEqual("Hide all comments"); Stream.toggleComments.call( link, {preventDefault: function(){} } ); jasmine.Clock.tick(200); - expect(link.text()).toEqual("comments.hide pl"); + expect(link.text()).toEqual("comments.show pl"); }); }); }); diff --git a/spec/lib/fake_spec.rb b/spec/lib/fake_spec.rb index f43302381..1e37c15a2 100644 --- a/spec/lib/fake_spec.rb +++ b/spec/lib/fake_spec.rb @@ -8,7 +8,7 @@ describe PostsFake do @people << post.author 4.times do comment = Factory(:comment, :post => post) - @people << comment.author + comment.author end @posts << post end @@ -41,10 +41,6 @@ describe PostsFake do @fakes.should_receive(:people_hash).and_return({}) @fake.author end - it 'refers to its comments array for comments' do - @fake.comments = [mock()] - @fake.comments - end it 'refers to its post for any other field' do @post.should_receive(:text) @fake.text |