test/dummy/spec/functional/blogline_spec.rb in inkwell-1.0.5 vs test/dummy/spec/functional/blogline_spec.rb in inkwell-1.1.1
- old
+ new
@@ -7,26 +7,26 @@
@morozovm = User.create :nick => "Morozovm"
@salkar_post = @salkar.posts.create :body => "salkar_post_test_body"
end
it "blogitem record should been created for new post" do
- ::Inkwell::BlogItem.where(:owner_id => @salkar.id, :is_owner_user => true).size.should == 1
- item = ::Inkwell::BlogItem.where(:owner_id => @salkar.id, :is_owner_user => true).first
+ ::Inkwell::BlogItem.where(:owner_id => @salkar.id, :owner_type => ::Inkwell::Constants::OwnerTypes::USER).size.should == 1
+ item = ::Inkwell::BlogItem.where(:owner_id => @salkar.id, :owner_type => ::Inkwell::Constants::OwnerTypes::USER).first
item.owner_id.should == @salkar.id
- item.is_owner_user.should be
+ item.owner_type.should == ::Inkwell::Constants::OwnerTypes::USER
item.item_id.should == @salkar_post.id
item.is_reblog.should == false
- item.is_comment.should == false
+ item.item_type.should == ::Inkwell::Constants::ItemTypes::POST
end
it "timeline items should been created for followers for new post" do
@talisman = User.create :nick => "Talisman"
@morozovm.follow @salkar
@talisman.follow @salkar
@salkar_post1 = @salkar.posts.create :body => "salkar_post_test_body"
- ::Inkwell::TimelineItem.where(:user_id => @morozovm.id, :is_comment => false, :item_id => @salkar_post1.id).size.should == 1
- ::Inkwell::TimelineItem.where(:user_id => @talisman.id, :is_comment => false, :item_id => @salkar_post1.id).size.should == 1
+ ::Inkwell::TimelineItem.where(:owner_id => @morozovm.id, :owner_type => ::Inkwell::Constants::OwnerTypes::USER, :item_type => ::Inkwell::Constants::ItemTypes::POST, :item_id => @salkar_post1.id).size.should == 1
+ ::Inkwell::TimelineItem.where(:owner_id => @talisman.id, :owner_type => ::Inkwell::Constants::OwnerTypes::USER, :item_type => ::Inkwell::Constants::ItemTypes::POST, :item_id => @salkar_post1.id).size.should == 1
end
it "user should have blogline with reblogs and his posts" do
@salkar_post1 = @salkar.posts.create :body => "salkar_post_test_body_1"
@salkar_post2 = @salkar.posts.create :body => "salkar_post_test_body_2"
@@ -56,10 +56,10 @@
bline[1].is_reblog_in_blogline.should == true
bline[2].should == @salkar_post9
bline[2].is_reblogged.should == true
bline[2].is_favorited.should == true
bline[2].is_reblog_in_blogline.should == false
- bline[2].item_id_in_line.should == ::Inkwell::BlogItem.where(:item_id => @salkar_post9.id, :is_comment => false).first.id
+ bline[2].item_id_in_line.should == ::Inkwell::BlogItem.where(:item_id => @salkar_post9.id, :item_type => ::Inkwell::Constants::ItemTypes::POST).first.id
bline[3].should == @salkar_post8
bline[4].should == @salkar_post7
bline[5].should == @salkar_post6
bline[6].should == @morozovm_post
bline[6].is_reblog_in_blogline.should == true
\ No newline at end of file