public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
added examples for block helpers
David Chelimsky (author)
Mon Aug 11 04:29:38 -0700 2008
commit  7a9d2ce1b3c1f1ac314433f925a46b7bbfa05851
tree    48884d749fe221a119ad7e3b4bcb226264128139
parent  e6701300f86f798bd47dd879cd5d572a64e49974
...
239
240
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
243
244
...
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
0
@@ -239,6 +239,20 @@ describe "An instantiated ViewExampleGroupController", :type => :view do
0
   end
0
 end
0
 
0
+describe "a block helper", :type => :view do
0
+  it "should not yield when not told to in the example" do
0
+    template.should_receive(:if_allowed)
0
+    render "view_spec/block_helper"
0
+    response.should_not have_tag("div","block helper was rendered")
0
+  end
0
+
0
+  it "should yield when told to in the example" do
0
+    template.should_receive(:if_allowed).and_yield
0
+    render "view_spec/block_helper"
0
+    response.should have_tag("div","block helper was rendered")
0
+  end
0
+end
0
+
0
 describe "render :inline => ...", :type => :view do
0
   it "should render ERB right in the spec" do
0
     render :inline => %|<%= text_field_tag('field_name', 'Value') %>|

Comments