move ostatus builder, actually added the file.
This commit is contained in:
parent
584684560e
commit
337831bba2
2 changed files with 32 additions and 1 deletions
|
|
@ -79,5 +79,4 @@ module Diaspora
|
||||||
XML
|
XML
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
32
spec/lib/diaspora/ostatus_builder_spec.rb
Normal file
32
spec/lib/diaspora/ostatus_builder_spec.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
require File.join(Rails.root, 'lib/diaspora/ostatus_builder')
|
||||||
|
|
||||||
|
|
||||||
|
describe Diaspora::OstatusBuilder do
|
||||||
|
|
||||||
|
let!(:user) { alice }
|
||||||
|
let(:aspect) { user.aspects.first }
|
||||||
|
let!(:public_status_messages) {
|
||||||
|
3.times.inject([]) do |arr,n|
|
||||||
|
s = user.post(:status_message, :message => "hey#{n}", :public => true, :to => aspect.id)
|
||||||
|
arr << s
|
||||||
|
end
|
||||||
|
}
|
||||||
|
let!(:private_status_messages) {
|
||||||
|
3.times.inject([]) do |arr,n|
|
||||||
|
s = user.post(:status_message, :message => "secret_ney#{n}", :public => false, :to => aspect.id)
|
||||||
|
arr << s
|
||||||
|
end
|
||||||
|
}
|
||||||
|
let!(:atom) { director = Diaspora::Director.new; director.build(Diaspora::OstatusBuilder.new(user, public_status_messages)) }
|
||||||
|
|
||||||
|
it 'should include a users posts' do
|
||||||
|
public_status_messages.each{ |status| atom.should include status.message }
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
Loading…
Reference in a new issue