Skip to content

Instantly share code, notes, and snippets.

View tdouce's full-sized avatar

Travis Douce tdouce

View GitHub Profile
@tdouce
tdouce / Gemfile
Created July 9, 2014 01:51
Part of 'Testing Rails Service Oriented Architecture' blog
group :test do
gem 'remote_database_cleaner'
end
@tdouce
tdouce / Gemfile
Last active August 29, 2015 14:03
Part of 'Testing Rails Service Oriented Architecture' blog
# Gemfile in *home*
group :test, :development do
gem 'factory_girl_rails'
gem 'remote_factory_girl_home_rails'
end
@tdouce
tdouce / Gemfile
Last active August 29, 2015 14:03
Part of 'Testing Rails Service Oriented Architecture' blog
# Gemfile in client
group :test do
gem 'remote_factory_girl'
end
@tdouce
tdouce / Gemfile
Last active August 29, 2015 14:03
Part of 'Testing Rails Service Oriented Architecture'
# Gemfile
group :test do
gem 'database_cleaner'
gem 'factory_girl_rails'
end
# config/routes.rb in home
YourApplication::Application.routes.draw do
...
if defined?(RemoteDatabaseCleanerHomeRails::Engine)
mount RemoteDatabaseCleanerHomeRails::Engine, at: '/remote_database_cleaner'
end
...
end
@tdouce
tdouce / test.rb
Last active August 29, 2015 14:03
# config/environments/test.rb
YourApplication::Application.configure do
...
config.remote_database_cleaner_home_rails.enable = true
...
end
# spec/spec_helper.rb in client
RemoteDatabaseCleaner.configure do |config|
config.home = { host: 'localhost',
port: 4000,
end_point: '/remote_database_cleaner/home/clean' }
end
RSpec.configure do |config|
config.before(:suite) do
RemoteDatabaseCleaner.clean
# config/routes.rb` in home
YourApplication::Application.routes.draw do
...
if defined?(RemoteFactoryGirlHomeRails::Engine)
mount RemoteFactoryGirlHomeRails::Engine, at: '/remote_factory_girl'
end
...
end
@tdouce
tdouce / test.rb
Last active August 29, 2015 14:03
# config/environments/test.rb in home
YourApplication::Application.configure do
...
config.remote_factory_girl_home_rails.enable = true
...
end
# spec/spec_helper.rb` in client
RemoteFactoryGirl.configure do |config|
config.home = { host: 'localhost',
port: 4000,
end_point: '/remote_factory_girl/home' }
config.return_with_root = false
end