From 8b5cffc321200590e97380462e6ecef8fb049890 Mon Sep 17 00:00:00 2001 From: Luis Martinez Date: Mon, 12 Dec 2022 12:44:19 -0600 Subject: [PATCH 1/2] Update README.md Rspec example added --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index d214949..426e8ac 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,18 @@ group :test do end ``` +## Rspec connection example +```ruby +# spec_helper.rb +require "database_cleaner-mongoid" +DatabaseCleaner[:mongoid].db = :default + # Clear DB + config.before(:suite) do + DatabaseCleaner[:mongoid].strategy = :deletion + end + +config.before(:each) { DatabaseCleaner[:mongoid].clean } +``` ## Supported Strategies The mongoid adapter only has one strategy: the deletion strategy. From 71297a5ef2c2688e7c16cd3532489f3e7575ce4f Mon Sep 17 00:00:00 2001 From: Luis Martinez Date: Fri, 3 Feb 2023 21:09:24 -0600 Subject: [PATCH 2/2] Update README.md Co-authored-by: Jon Rowe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 426e8ac..43c7d3f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ group :test do end ``` -## Rspec connection example +## RSpec connection example ```ruby # spec_helper.rb require "database_cleaner-mongoid"