MS found the stupid nil. from here, i have 33 failures.

This commit is contained in:
maxwell 2010-06-24 22:20:09 -07:00
parent 179af4fbfa
commit 64c1d99b8c
5 changed files with 10 additions and 18 deletions

View file

@ -15,8 +15,7 @@ module ApplicationHelper
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_body_contents_from_xml(xml)
doc = Nokogiri::XML(xml) { |cfg| cfg.noblanks }

View file

@ -1,22 +1,21 @@
class Post
require 'lib/common'
include ApplicationHelper
# XML accessors must always preceed mongo field tags
include MongoMapper::Document
include ROXML
include Diaspora::Webhooks
key :person_id, ObjectId
belongs_to :person, :class_name => 'Person'
timestamps!
after_save :send_to_view
after_save :print
def self.stream
Post.sort(:created_at.desc).all
@ -28,7 +27,7 @@ class Post
def self.newest(person = nil)
return self.last if person.nil?
self.where(:person_id => person.id).sort(:created_at.desc)
self.where(:person_id => person.id).last
end
def self.my_newest

View file

@ -9,6 +9,7 @@ class StatusMessage < Post
validates_presence_of :message
def ==(other)
(self.message == other.message) && (self.person.email == other.person.email)
end

View file

@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../spec_helper'
include ApplicationHelper
describe ApplicationHelper do
describe "parser in application helper" do
before do
@user = Factory.create(:user, :email => "bob@aol.com")
@friend =Factory.create(:friend, :email => "bill@gates.com")

View file

@ -12,9 +12,7 @@ include Devise::TestHelpers
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
Rspec.configure do |config|
#config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
DatabaseCleaner.strategy = :truncation
@ -34,9 +32,4 @@ Rspec.configure do |config|
#Factory.sequences.each{ |s| s.reset}
end
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, comment the following line or assign false
# instead of true.
# config.use_transactional_fixtures = true
end