From d2fec8a8fd2d20ff31593557515be59e535b0a7c Mon Sep 17 00:00:00 2001 From: okitan Date: Thu, 26 Jan 2012 23:08:48 +0900 Subject: [PATCH] I forgot to add ! method to Capybara::JSON --- CHANGELOG.md | 4 ++++ Gemfile | 1 - lib/capybara/json.rb | 4 ++-- spec/capybara/json_spec.rb | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfe192..af95219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2 +* BUGFIX + * I forgot to add get! etc to Capybara::DSL + ## 0.1.1 * ENHANCEMENT * get!, post!, put!, delete! diff --git a/Gemfile b/Gemfile index 1d2c017..864015c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ source "http://rubygems.org" # Specify your gem's dependencies in capybara-json.gemspec -gem 'capybara', '> 1.0.0' gemspec diff --git a/lib/capybara/json.rb b/lib/capybara/json.rb index 1c7e3a4..67519eb 100644 --- a/lib/capybara/json.rb +++ b/lib/capybara/json.rb @@ -14,7 +14,7 @@ def self.included(base) base.extend(self) end - %w[ get delete ].each do |method| + %w[ get get! delete delete! ].each do |method| module_eval %{ def #{method}(path, params = {}, env = {}) page.driver.#{method}(path, params, env) @@ -22,7 +22,7 @@ def #{method}(path, params = {}, env = {}) } end - %w[ post put ].each do |method| + %w[ post post! put put! ].each do |method| module_eval %{ def #{method}(path, json, env = {}) page.driver.#{method}(path, json, env) diff --git a/spec/capybara/json_spec.rb b/spec/capybara/json_spec.rb index 91f6b14..ca5dca7 100644 --- a/spec/capybara/json_spec.rb +++ b/spec/capybara/json_spec.rb @@ -20,14 +20,14 @@ Capybara.current_driver = Capybara.default_driver end - %w[ get delete ].each do |method| + %w[ get get! delete delete! ].each do |method| it "register #{method}" do __send__(method, '/') body.should == { 'Hello world!' => 'Hello world!' } end end - %w[ post put ].each do |method| + %w[ post post! put put! ].each do |method| it "register #{method}" do __send__(method, '/', {}) body.should == { 'Hello world!' => 'Hello world!' }