From 5cade230ac498641f6dc57728e81e8c1c57589bb Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 25 Jun 2010 15:33:23 -0700 Subject: [PATCH] added silly debug toggle --- app/views/layouts/application.html.haml | 4 +--- lib/common.rb | 3 +-- public/javascripts/view.js | 6 ++++++ spec/controllers/status_messages_controller_spec.rb | 6 +++--- spec/spec_helper.rb | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 965a5cbb4..20553cecc 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -85,6 +85,4 @@ #content = yield - - #debug - .msg + = render "posts/debug" diff --git a/lib/common.rb b/lib/common.rb index 2731bd929..14afff2f3 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -1,13 +1,12 @@ module Diaspora module Webhooks - include ApplicationHelper def self.included(klass) klass.class_eval do after_save :notify_friends @@queue = MessageHandler.new def notify_friends - if mine? self + if self.person_id == User.first.id xml = Post.build_xml_for(self) @@queue.add_post_request( friends_with_permissions, xml ) @@queue.process diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 847aa6133..53fdc03a0 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -29,6 +29,12 @@ $(document).ready(function(){ $(this).val("") }); + $('#debug_info').click(function() { + $('#debug_more').toggle('fast', function() { + + }); + }); + $('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130); diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index 37bd1c128..a03b6b2ab 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -37,20 +37,20 @@ describe StatusMessagesController do end it "destroy action should destroy model and redirect to index action" do - delete :destroy, :id => @status_message.id + delete :destroy, :id => @status_message._id response.should redirect_to(status_messages_url) StatusMessage.first(:conditions => {:id => @status_message.id }).nil?.should be true end it "show action should render show template" do - get :show, :id => @status_message.id + get :show, :id => @status_message.post_id response.should render_template(:show) end it "should return xml on show type if the MIME type exists" do request.env["HTTP_ACCEPT"] = "application/xml" message = StatusMessage.first - get :show, :id => message.id + get :show, :id => message.post_id response.body.include?(message.to_xml.to_s).should be true end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2b6f72bfc..781b66efb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,7 +24,7 @@ Rspec.configure do |config| config.before(:each) do DatabaseCleaner.start - WebSocket.stub!(:update_clients) + #WebSocket.stub!(:update_clients) end config.after(:each) do