GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Spec for :status in display
Yehuda Katz (author)
Sun Jul 06 21:50:54 -0700 2008
commit  3804f0c5b081a26f2b34d3eb89a1dd4634a3785a
tree    5676ae7ff2e0d52381e8f36587c5bcb92cbc32b5
parent  e277dc9938996065697e6dcd888fe4fefeeaaed5
...
85
86
87
 
 
 
 
 
 
 
88
89
90
...
85
86
87
88
89
90
91
92
93
94
95
96
97
0
@@ -85,6 +85,13 @@ module Merb::Test::Fixtures::Controllers
0
     end
0
   end
0
 
0
+ class DisplayWithStatus < Display
0
+ provides :json
0
+ def index
0
+ @obj = SomeModel.new
0
+ display @obj, :status => 500
0
+ end
0
+ end
0
 
0
   class DisplayWithSerializationOptions < Display
0
     provides :json
...
16
17
18
 
 
 
 
19
20
21
...
16
17
18
19
20
21
22
23
24
25
0
@@ -16,6 +16,10 @@ describe Merb::Controller, " displaying objects based on mime type" do
0
     dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithStringLocation, :index, {}, :http_accept => "application/json").headers['Location'].should =~ /some_resources/
0
   end
0
 
0
+ it "should set the status to a code provided by :status" do
0
+ dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithStatus, :index, {}, :http_accept => "application/json").status.should == 500
0
+ end
0
+
0
   it "should use a template if specified" do
0
     dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :index).body.should match(/Custom: Template/)
0
   end

Comments

    No one has commented yet.