Skip to content

Commit d30e739

Browse files
committed
Move Mongo test config to support file
1 parent 818a7e9 commit d30e739

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

spec/spec_helper.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@
4545

4646
Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |file| require file }
4747

48-
mongo_db_name = (ENV['MONGODB_DATABASE'] || '_ms_rails_test') + SecureRandom.hex(8)
49-
Mongoid.load_configuration(
50-
{
51-
clients: {
52-
default: {
53-
database: mongo_db_name,
54-
hosts: [ENV['MONGODB_HOST'] || 'localhost:27017'],
55-
options: {
56-
read: { mode: :primary },
57-
max_pool_size: 1
58-
}
59-
}
60-
}
61-
}
62-
)
63-
6448
RSpec.configure do |c|
6549
c.mock_with :rspec
6650
c.filter_run focus: true

spec/support/mongoid_config.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
mongo_db_name = (ENV['MONGODB_DATABASE'] || '_ms_rails_test') + SecureRandom.hex(8)
2+
Mongoid.load_configuration(
3+
{
4+
clients: {
5+
default: {
6+
database: mongo_db_name,
7+
hosts: [ENV['MONGODB_HOST'] || 'localhost:27017'],
8+
options: {
9+
read: { mode: :primary },
10+
max_pool_size: 1
11+
}
12+
}
13+
}
14+
}
15+
)

0 commit comments

Comments
 (0)