How to say “any_instance” “should_receive” any number of times in RSpec

后端 未结 7 1901
刺人心
刺人心 2020-12-14 05:24

I\'ve got an import controller in rails that imports several csv files with multiple records into my database. I would like to test in RSpec if the records are actually save

相关标签:
7条回答
  • 2020-12-14 06:09

    There's a new syntax for this:

    expect_any_instance_of(Model).to receive(:save).at_least(:once)
    
    0 讨论(0)
提交回复
热议问题