OSDN Git Service

Merge branch 'v05' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v05i18n
[pettanr/pettanr.git] / spec / models / speech_balloon_template_spec.rb
index c478800..e0f4e88 100644 (file)
@@ -15,25 +15,40 @@ describe SpeechBalloonTemplate do
     @jes = JSON.parse @tes
     
     @admin = FactoryGirl.create :admin
+    @user = FactoryGirl.create( :user_yas)
+    @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 = FactoryGirl.create :author, :user_id => @other_user.id
+    @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
   end
   
   describe '検証に於いて' do
     before do
-    end
-    
-    it 'オーソドックスなデータなら通る' do
       @st = FactoryGirl.build :speech_balloon_template
-      @st.should be_valid
     end
     
-    context 'nameを検証するとき' do
-      before do
-        @st = FactoryGirl.build :speech_balloon_template
+    context 'オーソドックスなデータのとき' do
+      it '下限データが通る' do
+        @st.name = 'a'
+        @st.classname = 'a'
+        @st.caption = 'a'
+        @st.t = 0
+        @st.settings = '{}'
+        @st.should be_valid
       end
-      it 'テストデータの確認' do
-        @st.name = 'abcdefghi0abcdefghi0abcdefghi0abcdefghi0abcdefghi0'
+      it '上限データが通る' do
+        @st.name = 'a'*50
+        @st.classname = 'a'*50
+        @st.caption = 'a'*30
+        @st.t = 99999
+        @st.settings = '{' + 'a'*99999 + '}'
         @st.should be_valid
       end
+    end
+    
+    
+    context 'nameを検証するとき' do
       it 'nullなら失敗する' do
         @st.name = ''
         @st.should_not be_valid
@@ -44,13 +59,6 @@ describe SpeechBalloonTemplate do
       end
     end
     context 'classnameを検証するとき' do
-      before do
-        @st = FactoryGirl.build :speech_balloon_template
-      end
-      it 'テストデータの確認' do
-        @st.classname = 'abcdefghi0abcdefghi0abcdefghi0abcdefghi0abcdefghi0'
-        @st.should be_valid
-      end
       it 'nullなら失敗する' do
         @st.classname = ''
         @st.should_not be_valid
@@ -61,13 +69,6 @@ describe SpeechBalloonTemplate do
       end
     end
     context 'captionを検証するとき' do
-      before do
-        @st = FactoryGirl.build :speech_balloon_template
-      end
-      it 'テストデータの確認' do
-        @st.caption = 'abcdefghi0abcdefghi0abcdefghi0'
-        @st.should be_valid
-      end
       it 'nullなら失敗する' do
         @st.caption = ''
         @st.should_not be_valid
@@ -78,13 +79,6 @@ describe SpeechBalloonTemplate do
       end
     end
     context 'tを検証するとき' do
-      before do
-        @st = FactoryGirl.build :speech_balloon_template
-      end
-      it 'テストデータの確認' do
-        @st.t = 0
-        @st.should be_valid
-      end
       it 'nullなら失敗する' do
         @st.t = nil
         @st.should_not be_valid
@@ -99,13 +93,6 @@ describe SpeechBalloonTemplate do
       end
     end
     context 'settingsを検証するとき' do
-      before do
-        @st = FactoryGirl.build :speech_balloon_template
-      end
-      it 'テストデータの確認' do
-        @st.settings = '{}'
-        @st.should be_valid
-      end
       it 'nullなら失敗する' do
         @st.settings = nil
         @st.should_not be_valid
@@ -113,377 +100,187 @@ describe SpeechBalloonTemplate do
     end
   end
   
-  describe 'データ補充に於いて' do
-    before do
-    end
-    
-  end
-  
-  describe 'Json解析に於いて' do
-    before do
-    end
-    context 'テキストを渡されたとき' do
-      it 'Json解析している' do
-        JSON.should_receive(:parse).with(@t).exactly(1)
-        r = SpeechBalloonTemplate.parse @t
-      end
-      it 'Hashで返す' do
-        r = SpeechBalloonTemplate.parse @t
-        r.is_a?(Hash).should be_true
-      end
-    end
-    context 'パース失敗したとき' do
-      it 'Falseを返す' do
-        JSON.should_receive(:parse).with(any_args).and_raise('StandardError')
-        r = SpeechBalloonTemplate.parse @t
-        r.should be_false
-      end
+  describe 'デフォルト値補充に於いて' do
+    it 'defined' do
+      @st = FactoryGirl.build :speech_balloon_template
+      @st.supply_default
     end
   end
   
-  describe 'システム画像置換に於いて' do
+  describe '上書き補充に於いて' do
     before do
-      @sp = FactoryGirl.create :system_picture
-      @sp2 = FactoryGirl.create :system_picture
       @st = FactoryGirl.build :speech_balloon_template
-      @hash = {"classname" => 'sore', "caption" => 'store test',
-        "templates" => {
-          "one" => {"balloon" => {"system_picture" => 'BASE64'}}
-        }
-      }
-      @hashs = {"classname" => 'sore2', "caption" => 'store test2',
-        "templates" => {
-          "one" => {"balloon" => {"system_picture" => 'DUAL'}},
-          "two" => {"balloon" => {"system_picture" => 'BASE64ENC'}}
-        }
-      }
     end
-    context '事前チェック' do
-      it 'システム画像に保存を依頼している' do
-        SystemPicture.stub(:store).with(any_args).and_return(@sp)
-        SystemPicture.should_receive(:store).exactly(1)
-        r = @st.pic_rehash @hash
-      end
+    it 'テーブルが空のときは0を返す' do
+      @st.overwrite
+      @st.t.should eq 0
     end
-    context 'つつがなく終わるとき' do
-      before do
-        SystemPicture.stub(:store).with(any_args).and_return(@sp)
-      end
-      it 'システム画像のidを作成している' do
-        r = @st.pic_rehash @hash
-        @hash["templates"]["one"]["balloon"].has_key?("system_picture_id").should be_true
-        @hash["templates"]["one"]["balloon"]["system_picture_id"].should eq @sp.id
-      end
-      it 'システム画像のテキストデータを削除している' do
-        r = @st.pic_rehash @hash
-        @hash["templates"]["one"]["balloon"].has_key?("system_picture").should_not be_true
-      end
-      it 'trueを返す' do
-        r = @st.pic_rehash @hash
-        r.should be_true
-      end
+    it 'テーブルが1行あるときは1を返す' do
+      FactoryGirl.create :speech_balloon_template
+      @st.overwrite
+      @st.t.should eq 1
     end
-    context 'システム画像の作成に失敗したとき' do
-      before do
-        SystemPicture.stub(:store).with(any_args).and_return(false)
-      end
-      it 'Falseを返す' do
-        r = @st.pic_rehash @hash
-        r.should be_false
-      end
+    it 'テーブルが2行あるときは2を返す' do
+      FactoryGirl.create :speech_balloon_template
+      FactoryGirl.create :speech_balloon_template, :name => "5", :t => 1
+      @st.overwrite
+      @st.t.should eq 2
     end
-    context '複数のとき' do
+    context 'つつがなく終わるとき' do
       before do
-        SystemPicture.stub(:store).with(any_args).and_return(@sp)
+        @st = FactoryGirl.create :speech_balloon_template, :t => 0
       end
-      it 'システム画像のidを作成している' do
-        r = @st.pic_rehash @hashs
-        @hashs["templates"]["one"]["balloon"].has_key?("system_picture_id").should be_true
-        @hashs["templates"]["one"]["balloon"]["system_picture_id"].should eq @sp.id
-        @hashs["templates"]["two"]["balloon"].has_key?("system_picture_id").should be_true
-        @hashs["templates"]["two"]["balloon"]["system_picture_id"].should eq @sp.id
-      end
-      it 'システム画像のテキストデータを削除している' do
-        r = @st.pic_rehash @hashs
-        @hashs["templates"]["one"]["balloon"].has_key?("system_picture").should_not be_true
-        @hashs["templates"]["two"]["balloon"].has_key?("system_picture").should_not be_true
-      end
-    end
-    context '例外データのとき' do
-      it 'templatesがなくても何ごともなく続行する' do
-        r = @st.pic_rehash({})
-        r.should be_true
-      end
-      it 'templatesが空でも何ごともなく続行する' do
-        r = @st.pic_rehash( {"templates" => nil})
-        r.should be_true
-      end
-      it 'balloonがなくても何ごともなく続行する' do
-        r = @st.pic_rehash({"templates" => {
-          "one" => {}
-        }})
-        r.should be_true
-      end
-      it 'balloonが空でも何ごともなく続行する' do
-        r = @st.pic_rehash({"templates" => {
-          "one" => {"balloon" => nil}
-        }})
-        r.should be_true
-      end
-      it 'system_pictureがなくても何ごともなく続行する' do
-        r = @st.pic_rehash({"templates" => {
-          "one" => {"balloon" => {}}
-        }})
-        r.should be_true
+      it '更新のときは補充しない' do
+        @st.overwrite
+        @st.t.should eq 0
       end
     end
   end
   
-  describe 'フキダシテンプレート保存に於いて' do
+  describe '閲覧許可に於いて' do
     before do
       @st = FactoryGirl.build :speech_balloon_template
-      @hash = {"classname" => 'sore', "caption" => 'store test'}
     end
-    context '事前チェック' do
-      it 'システム画像置換を依頼している' do
-        SpeechBalloonTemplate.any_instance.stub(:pic_rehash).with(@hash).and_return(true)
-        SpeechBalloonTemplate.any_instance.should_receive(:pic_rehash).exactly(1)
-        r = @st.store @hash
-      end
-    end
-    context 'つつがなく終わるとき' do
-      before do
-        SpeechBalloonTemplate.any_instance.stub(:pic_rehash).with(@hash).and_return(true)
-      end
-      it 'hashから取り出したclassnameをセットしている' do
-        @st.store @hash
-        @st.classname.should eq @hash["classname"]
-      end
-      it 'hashから取り出したcaptionをセットしている' do
-        @st.store @hash
-        @st.caption.should eq @hash["caption"]
-      end
-      it 'hashをテキスト化してsettingsにセットしている' do
-        @st.store @hash
-        @st.settings.should eq @hash.to_s
-      end
-      it 'フキダシテンプレートが作成されている' do
-        lambda {
-          @st.store @hash
-        }.should change SpeechBalloonTemplate, :count
-      end
-    end
-    context 'システム画像置換が失敗したとき' do
-      before do
-        SpeechBalloonTemplate.any_instance.stub(:pic_rehash).with(@hash).and_return(false)
-      end
-      it 'Falseを返す' do
-        r = @st.store @hash
-        r.should be_false
-      end
-    end
-    context '保存が失敗したとき' do
-      before do
-        SpeechBalloonTemplate.any_instance.stub(:pic_rehash).with(@hash).and_return(true)
-        SpeechBalloonTemplate.any_instance.stub(:save).with(any_args).and_return(false)
-      end
-      it 'Falseを返す' do
-        r = @st.store @hash
-        r.should be_false
-      end
+    it '許可する' do
+      @st.visible?(@author).should == true
     end
   end
   
-  describe 'フキダシテンプレート更新に於いて' do
+  describe '一覧取得に於いて' do
     before do
       @st = FactoryGirl.create :speech_balloon_template
-      @hash = {}
     end
     context 'つつがなく終わるとき' do
-      it '保存依頼している' do
-        SpeechBalloonTemplate.any_instance.stub(:store).with(@hash).and_return(true)
-        SpeechBalloonTemplate.should_receive(:store).exactly(1)
-        SpeechBalloonTemplate.store @st.name, @hash
-      end
-      context '新規のとき' do
-        #新規作成をチェックしたいが、楽するために(storeが保存しないことを利用して)新規オブジェクト生成かでテスト
-        it 'フキダシテンプレートは新規オブジェクトである' do
-          SpeechBalloonTemplate.any_instance.stub(:store).with(@hash).and_return(true)
-          r = SpeechBalloonTemplate.store :newsbtname, @hash
-          r.should be_a_new SpeechBalloonTemplate
-        end
-      end
-      context '更新のとき' do
-        it '名前が一致するテンプレを返す' do
-          SpeechBalloonTemplate.any_instance.stub(:store).with(@hash).and_return(true)
-          r = SpeechBalloonTemplate.store @st.name, @hash
-          r.name.should eq @st.name
-          r.should_not be_a_new SpeechBalloonTemplate
-        end
+      it '一覧取得オプションを利用している' do
+        SpeechBalloonTemplate.stub(:list_opt).with(any_args).and_return({})
+        SpeechBalloonTemplate.should_receive(:list_opt).with(any_args).exactly(1)
+        r = SpeechBalloonTemplate.list
       end
     end
-    context 'フキダシテンプレートの作成に失敗するとき' do
-      before do
-        SpeechBalloonTemplate.any_instance.stub(:store).with(any_args).and_return(false)
-      end
-      #成功失敗に関わらずオブジェクトを返すのでテストのやりようがない
-      
+    it 'リストを返す' do
+      l = SpeechBalloonTemplate.list
+      l.should eq [@st]
+    end
+    it 't順で並んでいる' do
+      @st2 = FactoryGirl.create :speech_balloon_template, :name => "5", :t => 1
+      l = SpeechBalloonTemplate.list
+      l.should eq [@st, @st2]
+    end
+  end
+  describe '一覧取得オプションに於いて' do
+    it '空のHashを返す' do
+      r = SpeechBalloonTemplate.list_opt
+      r.is_a?(Hash).should be_true
+      r.should be_empty
+    end
+  end
+  describe 'json一覧出力オプションに於いて' do
+    it '空のHashを返す' do
+      r = SpeechBalloonTemplate.list_json_opt
+      r.is_a?(Hash).should be_true
+      r.should be_empty
     end
   end
   
-  describe 'テキスト取り込みに於いて' do
-    #成功でTrue、パース失敗でFalse、失敗は保存エラーのモデルを配列で返す
+  describe '単体取得に於いて' do
     before do
+      @st = FactoryGirl.create :speech_balloon_template
     end
     context 'つつがなく終わるとき' do
-      it 'Json解析を依頼する' do
-        SpeechBalloonTemplate.should_receive(:parse).with(any_args).exactly(1)
-        SpeechBalloonTemplate.stub(:parse).with(any_args).and_return(@j)
-        SpeechBalloonTemplate.import(@t)
-      end
-      it 'フキダシテンプレート更新を一回依頼する' do
-        SpeechBalloonTemplate.stub(:store).with(any_args).and_return(SpeechBalloonTemplate.new)
-        SpeechBalloonTemplate.any_instance.stub(:valid?).with(any_args).and_return(true)
-        SpeechBalloonTemplate.should_receive(:store).with(any_args).exactly(1)
-        SpeechBalloonTemplate.import(@t)
-      end
-      it 'フキダシテンプレートが追加される' do
-        lambda {
-          SpeechBalloonTemplate.import(@t)
-        }.should change SpeechBalloonTemplate, :count
-      end
-      it '[]を返す' do
-        SpeechBalloonTemplate.import(@t).should eq []
+      it '単体取得オプションを利用している' do
+        SpeechBalloonTemplate.stub(:show_opt).with(any_args).and_return({})
+        SpeechBalloonTemplate.should_receive(:show_opt).with(any_args).exactly(1)
+        r = SpeechBalloonTemplate.show @st.id, @author
       end
     end
-    context '複数データがつつがなく終わるとき' do
-      it 'フキダシテンプレート更新を二回依頼する' do
-        SpeechBalloonTemplate.stub(:store).with(any_args).and_return(SpeechBalloonTemplate.new)
-        SpeechBalloonTemplate.any_instance.stub(:valid?).with(any_args).and_return(true)
-        SpeechBalloonTemplate.should_receive(:store).with(any_args).exactly(2)
-        SpeechBalloonTemplate.import(@ts)
-      end
-      it 'フキダシテンプレートが二個追加される' do
-        lambda {
-          SpeechBalloonTemplate.import(@ts)
-        }.should change(SpeechBalloonTemplate, :count).by 2
-      end
-      it '[]を返す' do
-        SpeechBalloonTemplate.import(@ts).should eq []
-      end
+    it '指定のフキダシテンプレートを返す' do
+      l = SpeechBalloonTemplate.show @st.id, @author
+      l.should eq @st
     end
-    #例外ケース
-    context 'Json解析に失敗したとき' do
-      before do
-        SpeechBalloonTemplate.stub(:parse).with(any_args).and_return(false)
-      end
-      it 'フキダシテンプレートの数に変化がない' do
-        lambda {
-          SpeechBalloonTemplate.import(@t)
-        }.should_not change SpeechBalloonTemplate, :count
-      end
-      it 'Falseを返す' do
-        SpeechBalloonTemplate.import(@t).should be_false
+    context '他人のフキダシテンプレートを開こうとしたとき' do
+      it '403Forbidden例外を返す' do
+        SpeechBalloonTemplate.any_instance.stub(:visible?).and_return(false)
+        lambda{
+          r = SpeechBalloonTemplate.show @st.id, @other_author
+        }.should raise_error(ActiveRecord::Forbidden)
       end
     end
-    context 'フキダシテンプレート作成に失敗したとき' do
-      before do
-        SpeechBalloonTemplate.any_instance.stub(:save).with(any_args).and_return(false)
-        SpeechBalloonTemplate.any_instance.stub(:valid?).with(any_args).and_return(false)
-      end
-      it 'フキダシテンプレートの数に変化がない' do
-        lambda {
-          SpeechBalloonTemplate.import(@t)
-        }.should_not change SpeechBalloonTemplate, :count
-      end
-      it '配列を返す' do
-        r = SpeechBalloonTemplate.import(@t)
-        r.is_a?(Array).should be_true
-      end
-      it '配列の中身は一件' do
-        r = SpeechBalloonTemplate.import(@t)
-        r.should have(1).items
-      end
-      it 'フキダシテンプレートオブジェクトが入っている' do
-        r = SpeechBalloonTemplate.import(@t)
-        r.first.is_a?(SpeechBalloonTemplate).should be_true
+    context '存在しないフキダシテンプレートを開こうとしたとき' do
+      it '404RecordNotFound例外を返す' do
+        lambda{
+          SpeechBalloonTemplate.show 110, @author
+        }.should raise_error(ActiveRecord::RecordNotFound)
       end
     end
-    context '複数のフキダシテンプレート作成に失敗したとき' do
-      #三件中、二件の失敗、一件を成功させ、成功データは戻り値に含まないことを確認する
-      it 'フキダシテンプレートの数に変化がない' do
-        lambda {
-          SpeechBalloonTemplate.import(@tes)
-        }.should_not change SpeechBalloonTemplate, :count
-      end
-      it '途中で保存に失敗しても全件更新依頼する' do
-        SpeechBalloonTemplate.stub(:store).with(any_args).and_return(SpeechBalloonTemplate.new)
-        SpeechBalloonTemplate.should_receive(:store).with(any_args).exactly(3)
-        SpeechBalloonTemplate.import(@tes)
-      end
-      it '配列を返す' do
-        r = SpeechBalloonTemplate.import(@tes)
-        r.is_a?(Array).should be_true
-      end
-      it '配列の中身は2件' do
-        r = SpeechBalloonTemplate.import(@tes)
-        r.should have(2).items
-      end
-      it '配列の中身は失敗したフキダシテンプレートオブジェクトが入っている' do
-        r = SpeechBalloonTemplate.import(@tes)
-        r[0].is_a?(SpeechBalloonTemplate).should be_true
-        r[0]["name"].should eq 'squareR@pettan.com'
-        r[1].is_a?(SpeechBalloonTemplate).should be_true
-        r[1]["name"].should eq 'squareRR@pettan.com'
-      end
+  end
+  describe '単体出力オプションに於いて' do
+    it '空のHashを返す' do
+      r = SpeechBalloonTemplate.show_opt
+      r.is_a?(Hash).should be_true
+      r.should be_empty
     end
   end
-  
-  describe 'インポートエラーの表示に於いて' do
+  describe 'json単体出力オプションに於いて' do
+    it '空のHashを返す' do
+      r = SpeechBalloonTemplate.show_json_opt
+      r.is_a?(Hash).should be_true
+      r.should be_empty
+    end
   end
   
-  describe 'ファイル取り込みに於いて' do
+  describe '更新に於いて' do
+    #置換まわりが破壊的でテストしにくいので、外部と連携したテストが多い。
+    #特にシステム画像データはidを直接記述して置換させないようにテストしている。
     before do
-      SpeechBalloonTemplate.stub(:import).with(any_args).and_return(true)
+      @sp = FactoryGirl.create :system_picture
+      @st = FactoryGirl.create :speech_balloon_template
+      @settings = {
+        "speech_balloon" => {"default" => 1}, 
+        "one" => {"balloon" => {"system_picture_id" => @sp.id}}
+      }
+      @attr = {"classname" => 'store', "caption" => 'store test',
+        "settings" => @settings
+      }
     end
-    context 'つつがなく終わるとき' do
+    context '事前チェック' do
       before do
-        SpeechBalloonTemplate.stub(:import).with(any_args).and_return(true)
+        SpeechBalloonTemplate.stub(:replace_system_picture).with(@settings).and_return(@settings)
+        SpeechBalloonTemplate.stub(:modify_object).with(any_args).and_return(@st)
+        SpeechBalloonTemplate.any_instance.stub(:overwrite).with(any_args).and_return(true)
+        SpeechBalloonTemplate.any_instance.stub(:save).with(any_args).and_return(true)
       end
-      it 'ã\83\95ã\82¡ã\82¤ã\83«ã\82\92é\96\8bã\81\84ã\81¦ã\83\86ã\82­ã\82¹ã\83\88ã\82\92読ã\82\80' do
-        File.should_receive(:open).with(@f, 'r').exactly(1)
-        SpeechBalloonTemplate.import_file(@f)
+      it 'ã\82·ã\82¹ã\83\86ã\83 ç\94»å\83\8fç½®æ\8f\9bã\81«ä¾\9dé ¼ã\81\97ã\81¦ã\81\84ã\82\8b' do
+        SpeechBalloonTemplate.should_receive(:replace_system_picture).with(@settings).exactly(1)
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
       end
-      it 'ã\83\86ã\82­ã\82¹ã\83\88å\8f\96ã\82\8aè¾¼ã\81¿ã\82\92ä¾\9dé ¼ã\81\99る' do
-        SpeechBalloonTemplate.should_receive(:import).with(any_args).exactly(1)
-        SpeechBalloonTemplate.import_file(@f)
+      it 'ã\82¤ã\83³ã\83\9dã\83¼ã\83\88å\87¦ç\90\86ã\81®ã\83\87ã\83¼ã\82¿æ\9b´æ\96°æº\96å\82\99ã\81«ä¾\9dé ¼ã\81\97ã\81¦ã\81\84る' do
+        SpeechBalloonTemplate.should_receive(:modify_object).exactly(1)
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
       end
-      #テキスト取り込み成功でTrueが返る
-      it 'Trueを返す' do
-        SpeechBalloonTemplate.import_file(@f).should be_true
+      it '上書き補充を依頼している' do
+        SpeechBalloonTemplate.any_instance.should_receive(:overwrite).exactly(1)
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
       end
-    end
-    context 'ファイルが開けないとき' do
-      before do
-        File.stub(:open).with(any_args).and_raise('StandardError')
-      end
-      it 'ファイルエラーのメッセージを出力する' do
-        pending
-      end
-      it 'Falseを返す' do
-        SpeechBalloonTemplate.import_file(@f).should be_false
+      it 'オブジェクトを保存している' do
+        SpeechBalloonTemplate.any_instance.should_receive(:save).exactly(1)
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
       end
     end
-    #失敗したときは、失敗したフキダシテンプレートが配列で返る
-    context 'テキスト取り込みが失敗したとき' do
+    context 'つつがなく終わるとき' do
       before do
-        SpeechBalloonTemplate.stub(:import).with(any_args).and_return(false)
       end
-      it '各フキダシテンプレートのエラーメッセージを出力する' do
-        pending
+      it 'カラム値のsettingsをセットしている' do
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
+        r.settings.should eq @settings.to_json.to_s
+      end
+      it 'モデルが作成されている' do
+        lambda {
+          r = SpeechBalloonTemplate.store 'circle_v01', @attr
+        }.should change SpeechBalloonTemplate, :count
       end
-      it 'Falseを返す' do
-        SpeechBalloonTemplate.import_file(@f).should be_false
+      it 'オブジェクトを返している' do
+        r = SpeechBalloonTemplate.store 'circle_v01', @attr
+        r.is_a?(SpeechBalloonTemplate).should be_true
       end
     end
   end