代码之家  ›  专栏  ›  技术社区  ›  shaan

Rspec给出错误的结果

  •  0
  • shaan  · 技术社区  · 6 年前

    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 
    

    我要走了 params[:some][:some_param] = 'true' 但测试用例还是通过了 任何想法!!!

    0 回复  |  直到 6 年前