diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 5e8423ae480..39f4e891fe3 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -34,7 +34,7 @@ def create end end - good_emails.each{|e| pp Resque.enqueue(Job::InviteUserByEmail, current_user.id, e, aspect, message)} + good_emails.each{|e| Resque.enqueue(Job::InviteUserByEmail, current_user.id, e, aspect, message)} if bad_emails.any? flash[:error] = I18n.t('invitations.create.sent') + good_emails.join(', ') + " "+ I18n.t('invitations.create.rejected') + bad_emails.join(', ') diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index f74b8f18b27..792ac7a9edf 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -65,7 +65,7 @@ class FakeError < RuntimeError; attr_accessor :original_exception; end 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 @@ class FakeError < RuntimeError; attr_accessor :original_exception; end 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 b161bac1c9c..a4576f0bd5a 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 f43302381a4..1e37c15a244 100644 --- a/spec/lib/fake_spec.rb +++ b/spec/lib/fake_spec.rb @@ -8,7 +8,7 @@ @people << post.author 4.times do comment = Factory(:comment, :post => post) - @people << comment.author + comment.author end @posts << post end @@ -41,10 +41,6 @@ @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