spec/accept_spec.rb in cuba-api-0.2.0 vs spec/accept_spec.rb in cuba-api-0.3.0
- old
+ new
@@ -29,11 +29,11 @@
it 'creates yaml' do
skip("to_yaml add extra line with ...") if defined?( JRUBY_VERSION ) and (( JRUBY_VERSION =~ /^1.6./ ) == 0 ) and ( nil == (RUBY_VERSION =~ /^1.8/) )
_, _, resp = Cuba.call({"SCRIPT_NAME" => "/bla.yaml"})
resp[ 0 ] = resp[ 0 ].sub(/.*!/, "---!").sub( /\n\n/, "\n")
- resp.join.must.eq "---!ruby/object:B {}\n"
+ resp.join.must.eq "Not Found"
_, _, resp = Cuba.call({"HTTP_ACCEPT" => "application/x-yaml"})
resp[ 0 ] = resp[ 0 ].sub(/.*!/, "---!").sub( /\n\n/, "\n")
resp.join.must.eq "---!ruby/object:B {}\n"
@@ -51,13 +51,11 @@
end
it 'gives preference to script extension' do
skip("to_yaml add extra line with ...") if defined?( JRUBY_VERSION ) and (( JRUBY_VERSION =~ /^1.6./ ) == 0 ) and ( nil == (RUBY_VERSION =~ /^1.8/) )
- _, _, resp = Cuba.call({"SCRIPT_NAME" => "/bla.yaml", "HTTP_ACCEPT" => "application/xml"})
+ status, _, resp = Cuba.call({"SCRIPT_NAME" => "/bla.yaml", "HTTP_ACCEPT" => "application/xml"})
resp[ 0 ] = resp[ 0 ].sub(/.*!/, "---!").sub( /\n\n/, "\n")
- resp.join.must.eq "---!ruby/object:B {}\n"
-
- status, _, _ = Cuba.call({"SCRIPT_NAME" => "/bla.xml", "HTTP_ACCEPT" => "application/x-yaml"})
+ resp.join.must.eq "Not Found"
status.must.eq 404
end
end