assert that prep_opts works; reference BaseStream types in lieu of subclassed AspectStream's
This commit is contained in:
parent
7572eaaf0d
commit
018a42b001
2 changed files with 17 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ module Diaspora
|
|||
# @return [Hash]
|
||||
def prep_opts(opts)
|
||||
defaults = {
|
||||
:type => AspectStream::TYPES_OF_POST_IN_STREAM,
|
||||
:type => BaseStream::TYPES_OF_POST_IN_STREAM,
|
||||
:order => 'created_at DESC',
|
||||
:limit => 15,
|
||||
:hidden => false
|
||||
|
|
|
|||
|
|
@ -140,6 +140,22 @@ describe User do
|
|||
end
|
||||
end
|
||||
|
||||
describe "#prep_opts" do
|
||||
it "defaults the opts" do
|
||||
time = Time.now
|
||||
Time.stub(:now).and_return(time)
|
||||
alice.send(:prep_opts, {}).should == {
|
||||
:type => BaseStream::TYPES_OF_POST_IN_STREAM,
|
||||
:order => 'created_at DESC',
|
||||
:limit => 15,
|
||||
:hidden => false,
|
||||
:order_field => :created_at,
|
||||
:order_with_table => "posts.created_at DESC",
|
||||
:max_time => time + 1
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
describe "#visible_posts" do
|
||||
context 'with many posts' do
|
||||
before do
|
||||
|
|
|
|||
Loading…
Reference in a new issue