OSDN Git Service

merge v06sheet
[pettanr/pettanr.git] / spec / models / speech_balloon_spec.rb
index 701f1c6..da4ea56 100644 (file)
@@ -4,6 +4,7 @@ require 'spec_helper'
 
 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
@@ -532,7 +533,7 @@ describe SpeechBalloon do
     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)
         )
@@ -541,7 +542,7 @@ describe SpeechBalloon do
         )
         @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)
         )
@@ -550,7 +551,7 @@ describe SpeechBalloon do
         )
         @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)
         )
@@ -559,7 +560,7 @@ describe SpeechBalloon do
         )
         @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)
         )