0
這是我的rspec文件。我有PosRequest.authorize_card(@payment_detail)
行3次。是否有DRYer方式來編寫此上下文?消除RSpec中的重複代碼上下文
context 'should get' do
it 'error message' do
PosRequest.authorize_card(@payment_detail)
@payment_detail.errorMsg.should_not eql(:nil)
end
it 'bank message' do
PosRequest.authorize_card(@payment_detail)
@payment_detail.cardMsg.should_not eql(:nil)
end
it 'claim message' do
PosRequest.authorize_card(@payment_detail)
@payment_detail.bankMsg.should_not eql(:nil)
end
end