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
Search Repo:
add specs for does_not_provide
ivey (author)
Sat Mar 22 16:19:58 -0700 2008
commit  68cbd675a4fc6433b4ee2d8218bf8e0c29461dfa
tree    1ae2037ead83d4519524472bfd8b299f11e9572a
parent  7698ddb3d316da71408683158e1adeba6d0cab74
...
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
0
@@ -47,5 +47,22 @@
0
       "nothing"
0
     end
0
   end
0
+
0
+ class ClassDoesntProvides < Responder
0
+ provides :xml
0
+ does_not_provide :html
0
+
0
+ def index
0
+ "nothing"
0
+ end
0
+ end
0
+
0
+ class DoesntProvide < Responder
0
+ def index
0
+ provides :xml
0
+ does_not_provide :html
0
+ "nothing"
0
+ end
0
+ end
0
 end
...
82
83
84
 
 
 
 
 
 
 
 
 
 
85
...
82
83
84
85
86
87
88
89
90
91
92
93
94
95
0
@@ -82,5 +82,15 @@
0
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::ClassOnlyProvides, :index, {}, :http_accept => "application/html")
0
     lambda { controller.content_type }.should raise_error(Merb::ControllerExceptions::NotAcceptable)
0
   end
0
+
0
+ it "should properly remove formats when does_not_provide is called in action" do
0
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::OnlyProvides, :index, {}, :http_accept => "application/html")
0
+ lambda { controller.content_type }.should raise_error(Merb::ControllerExceptions::NotAcceptable)
0
+ end
0
+
0
+ it "should properly remove formats when does_not_provide is called in controller" do
0
+ controller = dispatch_to(Merb::Test::Fixtures::Controllers::ClassOnlyProvides, :index, {}, :http_accept => "application/html")
0
+ lambda { controller.content_type }.should raise_error(Merb::ControllerExceptions::NotAcceptable)
0
+ end
0
 end

Comments

    No one has commented yet.