您好,我正在编写测试用例,其中必须检查是否将正确的参数发送到控制器,以下是我的Product
rspec
我得到context 'when some button is clicked ' do
it 'some other button value in the DOM has to set false value' do
find("label[for='someButton']").click()
click_button('Save')
allow_any_instance_of(SomeController).to receive(:update) do |*args|
expect(args[0].params[:some][:some_param]).to be('xyz') # but here params[:some][:some_param] is 'true' still the test case is passing
end
end
end
,但测试用例仍通过
任何想法!!!