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
You may try to count the number of new on the class. That is not actually tests the number of saves but may be enough
expect(Mutation).to receive(:new).at_least(:once)
If there is the only expectation of how many times it was saved. Then you probably want to use spy() instead of fully functioning factory, as in Harm de Wit own answer
allow(Mutation).to receive(:new).and_return(spy)
...
expect(Mutation.new).to have_received(:save).at_least(:once)