Rack::Remote is a small request intercepting Rack middleware to invoke remote calls over HTTP. This can be used to invoke e.g. factories on remote services for running integration tests on distributed applications.
Add this line to your application's Gemfile:
gem 'rack-remote'And then execute:
bundleOr install it yourself as:
gem install rack-remoteRegister available remote calls:
Rack::Remote.register :factory_bot do |params, env, request|
FactoryBot.create params[:factory]
endReturn value can be a Rack response array or any object that will be converted to JSON.
Rack::Remote.add :srv1, url: 'http://serv.domain.tld/proxyed/path'
Rack::Remote.invoke :srv1, :factory_bot, factory: 'user'
Rack::Remote.invoke 'http://serv.domain.tld/proxyed/path', :factory_bot, factory: 'user'- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Add specs
- Add features
- Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request