Skip to content

Commit

Permalink
I forgot to add ! method to Capybara::JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
okitan committed Jan 26, 2012
1 parent 125a5d1 commit d2fec8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions 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!
Expand Down
1 change: 0 additions & 1 deletion Gemfile
@@ -1,5 +1,4 @@
source "http://rubygems.org"

# Specify your gem's dependencies in capybara-json.gemspec
gem 'capybara', '> 1.0.0'
gemspec
4 changes: 2 additions & 2 deletions lib/capybara/json.rb
Expand Up @@ -14,15 +14,15 @@ 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)
end
}
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)
Expand Down
4 changes: 2 additions & 2 deletions spec/capybara/json_spec.rb
Expand Up @@ -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!' }
Expand Down

0 comments on commit d2fec8a

Please sign in to comment.