Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4084

Mongoid.purge in Rspec drop all database (test, development)

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 12_01_17
    • None

    Description

      Hi guys
      I recently upgraded from Rails 3.2 to 4.2.1. My spec_helper,rb

        config.after(:each) do
          Mongoid.purge!
        end
      

      After run rspec the database development is dropped too. Is there anyway to run Mongoid.purge! in specific database like Mongoid.purge!test
      Here is my rspec

      group :test, :development do
        gem "rspec-core", '~> 2.14.0'
        gem "rspec-rails", '~> 2.14.0'
        gem 'factory_girl_rails', require: false
        gem 'pry-byebug'
        gem 'pry-stack_explorer'
        gem 'spring'
        gem "spring-commands-rspec"
        gem 'quiet_assets'
        gem 'awesome_print'
      end
      

      Thanks !
      `

      Attachments

        Activity

          People

            durran.jordan@mongodb.com Durran Jordan
            lovedota lovedota
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: