Commit 05e6bab4a1c9eb47c0e7f90dac5e036fe1926172
1 parent
cab5c165
Exists in
master
and in
1 other branch
Avoid doing repair:database in test because can really take long time
The ProblemClearer launch a repair:database to limit the size of mongoDB database. Avoid to do it in test because can take 3s. This commit reduce by 3s the spec suite
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
spec/interactors/resolved_problem_clearer_spec.rb
| ... | ... | @@ -29,9 +29,12 @@ describe ResolvedProblemClearer do |
| 29 | 29 | |
| 30 | 30 | context "with problem resolve" do |
| 31 | 31 | before do |
| 32 | + Mongoid.config.master.stub(:command).and_call_original | |
| 33 | + Mongoid.config.master.stub(:command).with({:repairDatabase => 1}) | |
| 32 | 34 | problems.first.resolve! |
| 33 | 35 | problems.second.resolve! |
| 34 | 36 | end |
| 37 | + | |
| 35 | 38 | it 'delete problem resolve' do |
| 36 | 39 | expect { |
| 37 | 40 | expect(resolved_problem_clearer.execute).to eq 2 | ... | ... |