From 2045226ba731533a31e9d110edbbf2001be1301d Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 28 Dec 2009 15:24:49 -0600 Subject: [PATCH] More specs. --- spec/jasmine_self_test_config.rb | 4 ---- spec/server_spec.rb | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/jasmine_self_test_config.rb b/spec/jasmine_self_test_config.rb index cf01391..f8bd819 100644 --- a/spec/jasmine_self_test_config.rb +++ b/spec/jasmine_self_test_config.rb @@ -27,8 +27,4 @@ class JasmineSelfTestConfig < Jasmine::Config "/spec" => spec_dir } end -# -# def specs -# Jasmine.cachebust(spec_files).collect {|f| f.sub(spec_dir, "/spec")} -# end end \ No newline at end of file diff --git a/spec/server_spec.rb b/spec/server_spec.rb index 8d0ed6b..7397716 100644 --- a/spec/server_spec.rb +++ b/spec/server_spec.rb @@ -55,4 +55,11 @@ describe Jasmine::Server do body.should satisfy {|s| s.index("/src/file1.js") < s.index("/spec/file2.js") } end end + + it "should display an error using JS for 404's" do + code, headers, body = @thin_app.call("PATH_INFO" => "/spec/NonExistantFile.js", "SCRIPT_NAME" => "xxx") + code.should == 200 # todo: shouldn't this be 404? will that work with all browsers? + headers["Content-Type"].should == "application/javascript" + read(body).should == "document.write('

Couldn\\'t load /spec/NonExistantFile.js!

');" + end end \ No newline at end of file