spec/rack-api/runner_spec.rb in rack-api-1.0.2 vs spec/rack-api/runner_spec.rb in rack-api-1.1.0
- old
+ new
@@ -1,19 +1,16 @@
require "spec_helper"
describe Rack::API::Runner do
- specify "sanity check for delegate methods" do
- # remember to update spec/method_delegation_spec.rb
- Rack::API::Runner::DELEGATE_METHODS.size.should == 13
- end
-
it "responds to http methods" do
subject.should respond_to(:get)
subject.should respond_to(:post)
subject.should respond_to(:put)
subject.should respond_to(:delete)
subject.should respond_to(:head)
+ subject.should respond_to(:options)
+ subject.should respond_to(:patch)
end
it "sets available formats" do
subject.respond_to(:json, :jsonp, :atom)
subject.option(:formats).should == [:json, :jsonp, :atom]
@@ -48,10 +45,14 @@
:default_format => "fffuuu",
:prefix => "api",
:handler => proc {}
}
- Rack::API::Controller.should_receive(:new).with(hash_including(expected)).once
+ Rack::API::Controller
+ .should_receive(:new)
+ .with(hash_including(expected))
+ .and_return(mock.as_null_object)
+
subject.version("v1") do
respond_to :fffuuu
prefix "api"
default_url_options :host => "mysite.com"