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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

請(qǐng)教下面的這個(gè)方法的測(cè)試函數(shù)怎么寫?

請(qǐng)教下面的這個(gè)方法的測(cè)試函數(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)驗(yàn) 獲得超7個(gè)贊

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

it '邏輯測(cè)試' do
#你的邏輯
end

it '返回?cái)?shù)據(jù)測(cè)試' do
#你期待的返回?cái)?shù)據(jù)
end
end

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

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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