test/angelo_spec.rb in angelo-0.1.11 vs test/angelo_spec.rb in angelo-0.1.12
- old
+ new
@@ -184,10 +184,15 @@
__send__ m, '/bad_json_s' do
content_type :json
{hi: 'there'}.to_json.gsub /{/, 'so doge'
end
+ __send__ m, '/javascript' do
+ content_type :js
+ 'var foo = "bar";'
+ end
+
end
end
it 'sets html content type for current route' do
Angelo::HTTPABLE.each do |m|
@@ -219,9 +224,18 @@
it '500s on bad json strings' do
Angelo::HTTPABLE.each do |m|
__send__ m, '/bad_json_s'
last_response.status.must_equal 500
+ end
+ end
+
+ it 'sets javascript content type for current route' do
+ Angelo::HTTPABLE.each do |m|
+ __send__ m, '/javascript'
+ last_response.status.must_equal 200
+ last_response.body.to_s.must_equal 'var foo = "bar";'
+ last_response.headers['Content-Type'].split(';').must_include Angelo::JS_TYPE
end
end
end