Commit 05e6bab4a1c9eb47c0e7f90dac5e036fe1926172

Authored by Cyril Mougel
1 parent cab5c165
Exists in master and in 1 other branch production

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
spec/interactors/resolved_problem_clearer_spec.rb
@@ -29,9 +29,12 @@ describe ResolvedProblemClearer do @@ -29,9 +29,12 @@ describe ResolvedProblemClearer do
29 29
30 context "with problem resolve" do 30 context "with problem resolve" do
31 before do 31 before do
  32 + Mongoid.config.master.stub(:command).and_call_original
  33 + Mongoid.config.master.stub(:command).with({:repairDatabase => 1})
32 problems.first.resolve! 34 problems.first.resolve!
33 problems.second.resolve! 35 problems.second.resolve!
34 end 36 end
  37 +
35 it 'delete problem resolve' do 38 it 'delete problem resolve' do
36 expect { 39 expect {
37 expect(resolved_problem_clearer.execute).to eq 2 40 expect(resolved_problem_clearer.execute).to eq 2