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

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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None

      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 !
      `

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

              Created:
              Updated:
              Resolved: