OSDN Git Service

t#30200:update i18n devise
[pettanr/pettanr.git] / spec / models / ground_color_spec.rb
index 35ae8d8..c7123e7 100644 (file)
@@ -4,12 +4,12 @@ require 'spec_helper'
 
 describe GroundColor do
   before do
-    FactoryGirl.create :admin
+    @admin = FactoryGirl.create :admin
     @user = FactoryGirl.create( :user_yas)
-    @author = @user.author
+    @author = FactoryGirl.create :author, :user_id => @user.id
     @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
     @other_user = FactoryGirl.create( :user_yas)
-    @other_author = @other_user.author
+    @other_author = FactoryGirl.create :author, :user_id => @other_user.id
     @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
     @sp = FactoryGirl.create :system_picture
     @lg = FactoryGirl.create :license_group
@@ -121,13 +121,13 @@ describe GroundColor do
         GroundColor.page_size('1000').should eq GroundColor.max_page_size
       end
     end
-    context 'つつがなく終わるとき' do\r
-      it '一覧取得オプションを利用している' do\r
-        GroundColor.stub(:list_opt).with(any_args).and_return({:include => :panel})\r
-        GroundColor.should_receive(:list_opt).with(any_args).exactly(1)\r
+    context 'つつがなく終わるとき' do
+      it '一覧取得オプションを利用している' do
+        GroundColor.stub(:list_opt).with(any_args).and_return({:include => :panel})
+        GroundColor.should_receive(:list_opt).with(any_args).exactly(1)
         r = GroundColor.list
-      end\r
-    end\r
+      end
+    end
     it 'リストを返す' do
       pl = GroundColor.list
       pl.should eq [@gc]
@@ -210,10 +210,10 @@ describe GroundColor do
   end
   describe 'json一覧出力オプションに於いて' do
     before do
-      @op = FactoryGirl.create :original_picture, :artist_id => @artist.id\r
-      @p = FactoryGirl.create :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id\r
-      @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id\r
-      @sbt = FactoryGirl.create :speech_balloon_template\r
+      @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
+      @p = FactoryGirl.create :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id
+      @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id
+      @sbt = FactoryGirl.create :speech_balloon_template
       @comic = FactoryGirl.create :comic, :author_id => @author.id, :visible => 1
       @panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
       @story = FactoryGirl.create :story, :author_id => @author.id, :comic_id => @comic.id, :panel_id => @panel.id
@@ -244,13 +244,13 @@ describe GroundColor do
     before do
       @gc = FactoryGirl.create :ground_color, :panel_id => @panel.id, :color_id => @color.id
     end
-    context 'つつがなく終わるとき' do\r
-      it '一覧取得オプションを利用している' do\r
-        GroundColor.stub(:list_opt).with(any_args).and_return({:include => :panel})\r
-        GroundColor.should_receive(:list_opt).with(any_args).exactly(1)\r
+    context 'つつがなく終わるとき' do
+      it '一覧取得オプションを利用している' do
+        GroundColor.stub(:list_opt).with(any_args).and_return({:include => :panel})
+        GroundColor.should_receive(:list_opt).with(any_args).exactly(1)
         r = GroundColor.mylist @author
-      end\r
-    end\r
+      end
+    end
     it 'リストを返す' do
       pl = GroundColor.mylist @author
       pl.should eq [@gc]
@@ -303,7 +303,7 @@ describe GroundColor do
         @gc3 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 2, :color_id => @color.id, :updated_at => Time.now + 200
         @gc4 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 3, :color_id => @color.id, :updated_at => Time.now + 300
         @gc5 = FactoryGirl.create :ground_color, :panel_id => @panel.id, :z => 4, :color_id => @color.id, :updated_at => Time.now + 400
-        Author.stub(:default_ground_color_page_size).and_return(2)\r
+        Author.stub(:default_ground_color_page_size).and_return(2)
       end
       it '通常は全件(5件)を返す' do
         r = GroundColor.mylist @author, 5, 0