OSDN Git Service

t#32046:add sheet
[pettanr/pettanr.git] / spec / controllers / sheet_panels_controller_spec.rb
index 5040adf..91afb36 100644 (file)
@@ -507,7 +507,7 @@ if MagicNumber['run_mode'] == 1
 
   describe '編集フォーム表示に於いて' do
     before do
-      @sheet_panel = FactoryGirl.create :sheet_panel, :author_id => @author.id
+      @sheet_panel = FactoryGirl.create :sheet_panel, :sheet_id => @sheet.id, :panel_id => @panel.id, :author_id => @author.id
       sign_in @user
       SheetPanel.stub(:show).and_return(@sheet_panel)
     end
@@ -601,8 +601,8 @@ if MagicNumber['run_mode'] == 1
 
   describe '更新に於いて' do
     before do
-      @sheet_panel = FactoryGirl.create :sheet_panel, :author_id => @user.author.id
-      @attr = FactoryGirl.attributes_for(:sheet_panel, :author_id => @author.id)
+      @sheet_panel = FactoryGirl.create :sheet_panel, :sheet_id => @sheet.id, :panel_id => @panel.id, :author_id => @user.author.id
+      @attr = FactoryGirl.attributes_for(:sheet_panel, :x => 5566, :author_id => @author.id)
       sign_in @user
     end
     context 'つつがなく終わるとき' do
@@ -624,10 +624,11 @@ if MagicNumber['run_mode'] == 1
         SheetPanel.any_instance.should_receive(:store).exactly(1)
         put :update, :id => @sheet_panel.id, :sheet_panel => @attr
       end
-      it "@sheet_panelに作成された紙コマを保持していて、それがDBにある" do
+      it "@sheet_panelに更新された紙コマを保持していて、それがDBにある" do
         put :update, :id => @sheet_panel.id, :sheet_panel => @attr
         assigns(:sheet_panel).should be_a(SheetPanel)
         assigns(:sheet_panel).should be_persisted
+        assigns(:sheet_panel).x.should eq 5566
       end
       context 'html形式' do
         it 'ステータスコード302 Foundを返す' do