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
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
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