Changeset 1328
- Timestamp:
- 01/28/08 11:52:57 (9 months ago)
- Files:
-
- trunk/spec/merb/render_spec.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/spec/merb/render_spec.rb
r1325 r1328 418 418 c = new_spec_controller(:format => 'json', :controller => 'RenderHashObjectController') 419 419 c.dispatch(:render_object) 420 c.body.should == "{\"baz\": \"quuz\", \"foo\": \"bar\"}"420 JSON.load(c.body).should == {'baz' => "quuz", "foo" => "bar"} 421 421 end 422 422 … … 424 424 c = new_spec_controller(:format => 'xml', :controller => 'RenderHashObjectController') 425 425 c.dispatch(:render_object) 426 c.body.should == "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<hash>\n <baz>quuz</baz>\n <foo>bar</foo>\n</hash>\n" 426 c.body.should match(/<\?xml version="1.0" encoding="UTF-8"\?>\n<hash>/m) 427 c.body.should match(/(<baz>quuz<\/baz>\n\s+<foo>bar<\/foo>\n<\/hash>)|(<foo>bar<\/foo>\n\s+<baz>quuz<\/baz>\n<\/hash>)/m) 427 428 end 428 429
