Browse files

Fixing bug with Rack call stack being executed twice.

  • Loading branch information...
1 parent f53823c commit c51081f4f75c9bf731404fa8349e78126e98bc28 @martincik committed Dec 15, 2010
Showing with 6 additions and 3 deletions.
  1. +1 −0 README.markdown
  2. +2 −2 lib/rack/rack-restful_submit.rb
  3. +1 −1 rack-restful_submit.gemspec
  4. +2 −0 spec/rack-restful_submit_spec.rb
View
1 README.markdown
@@ -97,6 +97,7 @@ License
History
-------
+1.1.2 - Fixing bug with double Rack call()
1.1.1 - Define Gemfile and decrease RSpec version to 1.3.0
1.1.0 - Version with MethodOverride support inside
1.0.0 - First working version
View
4 lib/rack/rack-restful_submit.rb
@@ -19,10 +19,10 @@ def call(env)
if mapping && mapping['url'] && mapping['method']
rewrite(env, mapping['url'], mapping['method'])
else
- super(env)
+ return super(env)
end
else
- super(env)
+ return super(env)
end
end
View
2 rack-restful_submit.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = "rack-restful_submit"
- s.version = "1.1.1"
+ s.version = "1.1.2"
s.platform = Gem::Platform::RUBY
s.authors = ["Ladislav Martincik"]
s.email = ["ladislav.martincik@gmail.com"]
View
2 spec/rack-restful_submit_spec.rb
@@ -74,6 +74,7 @@
end
it { out_env['REQUEST_METHOD'].should == method }
+ it { app.should_receive(:call).once.with(in_env); out_env }
end
describe "with #{method} and valid __rewrite args" do
@@ -103,6 +104,7 @@
end
it { out_env['REQUEST_METHOD'].should == method }
+ it { app.should_receive(:call).once.with(in_env); out_env }
end
end
end

0 comments on commit c51081f

Please sign in to comment.