describe SpeechBalloon do
before do
+ SpeechBalloonTemplate.delete_all
@admin = FactoryGirl.create :admin
@user = FactoryGirl.create( :user_yas)
@author = FactoryGirl.create :author, :user_id => @user.id
end
context 'DBに5件あって1ページの件数を2件に変えたとして' do
before do
- @other_sb2 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 1, :speech_balloon_template_id => @speech_balloon_template.id
+ @other_sb2 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 1, :speech_balloon_template_id => @speech_balloon_template.id, :updated_at => Time.now + 100
@other_sb2.build_speech(
FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
)
)
@other_sb2.boost
@other_sb2.save!
- @other_sb3 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 2, :speech_balloon_template_id => @speech_balloon_template.id
+ @other_sb3 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 2, :speech_balloon_template_id => @speech_balloon_template.id, :updated_at => Time.now + 200
@other_sb3.build_speech(
FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
)
)
@other_sb3.boost
@other_sb3.save!
- @other_sb4 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 3, :speech_balloon_template_id => @speech_balloon_template.id
+ @other_sb4 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 3, :speech_balloon_template_id => @speech_balloon_template.id, :updated_at => Time.now + 300
@other_sb4.build_speech(
FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
)
)
@other_sb4.boost
@other_sb4.save!
- @other_sb5 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 4, :speech_balloon_template_id => @speech_balloon_template.id
+ @other_sb5 = FactoryGirl.build :speech_balloon, :panel_id => @other_panel.id, :t => 4, :speech_balloon_template_id => @speech_balloon_template.id, :updated_at => Time.now + 400
@other_sb5.build_speech(
FactoryGirl.attributes_for(:speech, :writing_format_id => @writing_format.id)
)