added silly debug toggle
This commit is contained in:
parent
f9879752d3
commit
5cade230ac
5 changed files with 12 additions and 9 deletions
|
|
@ -85,6 +85,4 @@
|
||||||
|
|
||||||
#content
|
#content
|
||||||
= yield
|
= yield
|
||||||
|
= render "posts/debug"
|
||||||
#debug
|
|
||||||
.msg
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
module Diaspora
|
module Diaspora
|
||||||
module Webhooks
|
module Webhooks
|
||||||
include ApplicationHelper
|
|
||||||
def self.included(klass)
|
def self.included(klass)
|
||||||
klass.class_eval do
|
klass.class_eval do
|
||||||
after_save :notify_friends
|
after_save :notify_friends
|
||||||
@@queue = MessageHandler.new
|
@@queue = MessageHandler.new
|
||||||
|
|
||||||
def notify_friends
|
def notify_friends
|
||||||
if mine? self
|
if self.person_id == User.first.id
|
||||||
xml = Post.build_xml_for(self)
|
xml = Post.build_xml_for(self)
|
||||||
@@queue.add_post_request( friends_with_permissions, xml )
|
@@queue.add_post_request( friends_with_permissions, xml )
|
||||||
@@queue.process
|
@@queue.process
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,12 @@ $(document).ready(function(){
|
||||||
$(this).val("")
|
$(this).val("")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#debug_info').click(function() {
|
||||||
|
$('#debug_more').toggle('fast', function() {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
|
$('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130);
|
||||||
|
|
|
||||||
|
|
@ -37,20 +37,20 @@ describe StatusMessagesController do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "destroy action should destroy model and redirect to index action" do
|
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)
|
response.should redirect_to(status_messages_url)
|
||||||
StatusMessage.first(:conditions => {:id => @status_message.id }).nil?.should be true
|
StatusMessage.first(:conditions => {:id => @status_message.id }).nil?.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
it "show action should render show template" do
|
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)
|
response.should render_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return xml on show type if the MIME type exists" do
|
it "should return xml on show type if the MIME type exists" do
|
||||||
request.env["HTTP_ACCEPT"] = "application/xml"
|
request.env["HTTP_ACCEPT"] = "application/xml"
|
||||||
message = StatusMessage.first
|
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
|
response.body.include?(message.to_xml.to_s).should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ Rspec.configure do |config|
|
||||||
|
|
||||||
config.before(:each) do
|
config.before(:each) do
|
||||||
DatabaseCleaner.start
|
DatabaseCleaner.start
|
||||||
WebSocket.stub!(:update_clients)
|
#WebSocket.stub!(:update_clients)
|
||||||
end
|
end
|
||||||
|
|
||||||
config.after(:each) do
|
config.after(:each) do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue