OSDN Git Service

t#29045:create overwrite on panel
[pettanr/pettanr.git] / spec / models / panel_spec.rb
index f0e02e9..ee50463 100644 (file)
@@ -1,8 +1,6 @@
 # -*- encoding: utf-8 -*-\r
 require 'spec_helper'\r
 #コマ\r
-#add publish flag\r
-#own visible list_json_opt\r
 describe Panel do\r
   before do\r
     Factory :admin\r
@@ -192,31 +190,25 @@ describe Panel do
     end\r
   end\r
   \r
-  describe 'ã\83\87ã\83¼ã\82¿補充に於いて' do\r
+  describe 'ã\83\87ã\83\95ã\82©ã\83«ã\83\88å\80¤補充に於いて' do\r
     before do\r
       @panel = Factory.build :panel, :author_id => @author.id\r
     end\r
-    context 'widthを補充' do\r
+    it 'borderは2を補充する' do\r
+      @panel.border = nil\r
+      @panel.supply_default\r
+      @panel.border.should eq 2\r
     end\r
-    context 'heightを補充' do\r
-    end\r
-    context 'borderを補充' do\r
-      it '空の時は0を補充する' do\r
-        @panel.border = nil\r
-        @panel.supply_default @author\r
-        @panel.border.should eq 0\r
-      end\r
-      it '空でない時は変化しない' do\r
-        @panel.border = 1\r
-        lambda {\r
-          @panel.supply_default @author\r
-        }.should_not change @panel, :border\r
-      end\r
+  end\r
+  \r
+  describe '上書き補充に於いて' do\r
+    before do\r
+      @panel = Factory.build :panel, :author_id => @author.id\r
     end\r
     context 'author_idを補充' do\r
       it 'ログイン中の作家idを補充する' do\r
         @panel.author_id = nil\r
-        @panel.supply_default @author\r
+        @panel.overwrite @author\r
         @panel.author_id.should eq @author.id\r
       end\r
     end\r