Sha256: db20b5815e7c3acddce2038fd438d53474de3bfccc7c504a747ad886162cce40
Contents?: true
Size: 872 Bytes
Versions: 43
Compression:
Stored size: 872 Bytes
Contents
require 'spec_helper' require 'rack/jasmine/runner' describe Rack::Jasmine::Runner do describe "#call" do let(:content) { "some content" } let(:page) { double(Jasmine::Page, :render => content)} let(:runner) { Rack::Jasmine::Runner.new(page)} subject { runner.call("PATH_INFO" => path) } context "PATH_INFO is /" do let(:expected_headers) { {"Content-Type" => "text/html"} } let(:path) { "/" } it "should return a response with the passed content" do subject.should == [200, expected_headers, [content]] end end context "PATH_INFO is not /" do let(:path) { "/some_foo" } let(:expected_headers) { {"Content-Type" => "text/plain", "X-Cascade" => "pass"} } it "should return a 404" do subject.should == [404, expected_headers, ["File not found: #{path}\n"]] end end end end
Version data entries
43 entries across 41 versions & 4 rubygems