From de0bff17dd2ca8f52c31b700663985f81052618f Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 2 Jul 2010 11:11:59 -0700 Subject: [PATCH] Removed headers --- lib/common.rb | 20 -------------------- spec/lib/common_spec.rb | 23 ----------------------- spec/lib/parser_spec.rb | 5 ----- 3 files changed, 48 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index a5b97ec24..dcee9bec2 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -1,16 +1,5 @@ module Diaspora module XMLParser -=begin - def parse_sender_id_from_xml(xml) - doc = Nokogiri::XML(xml) { |cfg| cfg.noblanks } - doc.xpath("/XML/head/sender/email").text.to_s - end - - def parse_sender_object_from_xml(xml) - sender_id = parse_sender_id_from_xml(xml) - Friend.where(:email =>sender_id ).first - end -=end def parse_owner_from_xml(xml) doc = Nokogiri::XML(xml) { |cfg| cfg.noblanks } @@ -81,21 +70,12 @@ module Diaspora def self.build_xml_for(posts) xml = "" - xml += Post.generate_header xml += "\n " posts.each {|x| xml << x.prep_webhook} xml += "" xml += "" end - - def self.generate_header - " - - #{User.first.email} - - " - end end end end diff --git a/spec/lib/common_spec.rb b/spec/lib/common_spec.rb index 61e7fa3cc..3af047a95 100644 --- a/spec/lib/common_spec.rb +++ b/spec/lib/common_spec.rb @@ -11,29 +11,6 @@ describe Diaspora do @friend = Factory.create(:friend) end - describe "header" do - before do - Factory.create(:status_message) - Factory.create(:bookmark) - stream = Post.stream - @xml = Post.build_xml_for(stream) - end - - it "should generate" do - @xml.should include "" - @xml.should include "" - end - - it "should provide a sender" do - @xml.should include "" - @xml.should include "" - end - - it "should provide the owner's email" do - @xml.should include "#{User.first.email}" - end - end - describe "body" do before do @post = Factory.create(:status_message, :person => @user) diff --git a/spec/lib/parser_spec.rb b/spec/lib/parser_spec.rb index a9e3e7e45..c1eb5cb19 100644 --- a/spec/lib/parser_spec.rb +++ b/spec/lib/parser_spec.rb @@ -67,11 +67,6 @@ describe "parser in application helper" do @xml = Post.build_xml_for(@status_messages) end - it 'should be able to parse the sender\'s unique id' do - parse_sender_id_from_xml(@xml).should == @user.email - end - - it 'should be able to parse the body\'s contents' do body = parse_body_contents_from_xml(@xml).to_s body.should_not include ""