OSDN Git Service

t#31834:new base
[pettanr/pettanr.git] / spec / controllers / speeches_controller_spec.rb
index abb4ba2..679c1bf 100644 (file)
@@ -13,6 +13,7 @@ describe SpeechesController do
     @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
 
     @speech_balloon_template = FactoryGirl.create :speech_balloon_template
+    @writing_format = FactoryGirl.create :writing_format
     @panel = FactoryGirl.create :panel, :author_id => @author.id
   end
 
@@ -21,7 +22,7 @@ if MagicNumber['run_mode'] == 1
     before do
       @sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
       @balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
-      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
       sign_in @user
       Speech.stub(:list).and_return([@speech, @speech, @speech])
     end
@@ -144,7 +145,7 @@ if MagicNumber['run_mode'] == 1
       sign_in @user
       @sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
       @balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
-      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
       Speech.stub(:show).and_return(@speech)
     end
     context 'つつがなく終わるとき' do
@@ -235,7 +236,7 @@ else
     before do
       @sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
       @balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
-      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
       sign_in @user
       Speech.stub(:list).and_return([@speech, @speech, @speech])
     end
@@ -285,7 +286,7 @@ else
       sign_in @user
       @sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
       @balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
-      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+      @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
       Speech.stub(:show).and_return(@speech)
     end
     context 'つつがなく終わるとき' do