webrat/spec/private/sinatra/sinatra_session_spec.rb

29 lines
967 B
Ruby
Raw Normal View History

require File.expand_path(File.dirname(__FILE__) + '/helper')
2008-12-29 08:05:04 +00:00
describe Webrat::SinatraSession, "API" do
before :each do
Webrat.configuration.mode = :sinatra
@sinatra_session = Webrat::SinatraSession.new
end
2009-01-16 17:51:01 +00:00
it "should delegate get to sinatras get" do
@sinatra_session.should_receive(:orig_get).with("url", { :env => "headers" })
@sinatra_session.get("url", {}, "headers")
end
2009-01-16 17:51:01 +00:00
it "should delegate post to sinatras post" do
@sinatra_session.should_receive(:orig_post).with("url", { :env => "headers" })
@sinatra_session.post("url", {}, "headers")
end
2009-01-16 17:51:01 +00:00
it "should delegate put to sinatras put" do
@sinatra_session.should_receive(:orig_put).with("url", { :env => "headers" })
@sinatra_session.put("url", {}, "headers")
end
2009-01-16 17:51:01 +00:00
it "should delegate delete to sinatras delete" do
@sinatra_session.should_receive(:orig_delete).with("url", { :env => "headers" })
@sinatra_session.delete("url", {}, "headers")
end
2009-01-16 17:51:01 +00:00
end