第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請教下面的這個方法的測試函數(shù)怎么寫?

請教下面的這個方法的測試函數(shù)怎么寫?

皈依舞 2023-03-15 19:15:42
# POST /bumonsdef create@bumon = Bumon.new(params[:bumon])bumonsyozoku = Bumonsyozoku.newrespond_to do |format|if @bumon.savebumonsyozoku.bumon_id = @bumon.idbumonsyozoku.syozokbumon_id = @bumon.idbumonsyozoku.syozokulevel = 0bumonsyozoku.saveflag = params[:bumonsyozoku]["syozokubumon_id"]if flag !=nil && flag !=""parent_bumon = Bumonsyozoku.find(:all, :conditions => "bumon_id = #{flag}")parent_bumon.each{|x| y=Bumonsyozoku.new ; y.bumon_id = @bumon.id; y.syozokulevel = x.syozokulevel + 1;y.syozokbumon_id=x.syozokbumon_id; y.save}endflash[:notice] = 'Bumon was successfully created.'format.ext_json { render :json => @bumon.to_ext_json(:success => true) }elseformat.ext_json { render :json => @bumon.to_ext_json(:success => false) }endendend
查看完整描述

1 回答

?
吃雞游戲

TA貢獻(xiàn)1829條經(jīng)驗 獲得超7個贊

rsepc 的話
describe 'bumons測試' do
before do
post :bumons,{ #你的測試數(shù)據(jù)}
end

it '邏輯測試' do
#你的邏輯
end

it '返回數(shù)據(jù)測試' do
#你期待的返回數(shù)據(jù)
end
end

查看完整回答
反對 回復(fù) 2023-03-18
  • 1 回答
  • 0 關(guān)注
  • 91 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號