Sha256: 55bd9977a9301ff4f2d610d5fbaabc74b8dc13f5ed9f79e9468e32f698c5fba3
Contents?: true
Size: 857 Bytes
Versions: 1
Compression:
Stored size: 857 Bytes
Contents
require 'capybara' require 'capybara/dsl' module Capybara module Json def self.to_include Capybara.const_defined?("DSL") ? Capybara::DSL : Capybara end def self.included(base) base.__send__(:include, to_include) unless base < to_include base.extend(self) end %w[ get delete ].each do |method| module_eval %{ def #{method}(path, params = {}, env = {}) page.driver.#{method}(path, params, env) end } end %w[ post put ].each do |method| module_eval %{ def #{method}(path, json, env = {}) page.driver.#{method}(path, json, env) end } end end module RackTestJson autoload :Driver, 'capybara/rack_test_json/driver' end end Capybara.register_driver :rack_test_json do |app| Capybara::RackTestJson::Driver.new(app) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
capybara-json-0.0.2 | lib/capybara/json.rb |