Permalink
Browse files

added ViewStubHelpers

  • Loading branch information...
1 parent b93a1e4 commit 0c773b7384d8540689c533309b860d81c4132760 Russell Norris committed Jan 27, 2009
Showing with 16 additions and 0 deletions.
  1. +1 −0 lib/lucky_sneaks/view_spec_helpers.rb
  2. +15 −0 lib/lucky_sneaks/view_stub_helpers.rb
@@ -9,6 +9,7 @@ module LuckySneaks
# LuckySneaks::ViewSpecHelpers::ExampleGroupLevelMethods.
module ViewSpecHelpers
include LuckySneaks::CommonSpecHelpers
+ include LuckySneaks::ViewStubHelpers
include ActionController::PolymorphicRoutes
def self.included(base) # :nodoc:
@@ -0,0 +1,15 @@
+$:.unshift File.join(File.dirname(__FILE__), "..")
+require "skinny_spec"
+
+module LuckySneaks
+ # These methods are designed to be used in your example <tt>before</tt> blocks to accomplish
+ # a whole lot of functionality with just a tiny bit of effort.
+ module ViewStubHelpers
+ # Shorthand for the following stub:
+ #
+ # template.stub!(:render).with(hash_including(:partial => anything))
+ def stub_partial_rendering!
+ template.stub!(:render).with(hash_including(:partial => anything))
+ end
+ end
+end

0 comments on commit 0c773b7

Please sign in to comment.