Skip to content

Instantly share code, notes, and snippets.

@mikew
Forked from monde/shoulda_partials.rb
Created November 20, 2009 00:22
Show Gist options
  • Save mikew/239170 to your computer and use it in GitHub Desktop.
Save mikew/239170 to your computer and use it in GitHub Desktop.
# shoulda validation that a partial has been rendered by a view
class Test::Unit::TestCase
def self.should_render_partial(partial)
should "render partial #{partial.inspect}" do
# add the underscore. it's expected anyways
assert_template :partial => partial.to_s.sub(/\/(\w+)$/, '/_\1')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment