view_test 0.10.0 released
on August 25, 2007 @ 07:23 PM
view_test 0.10.0 has been released. Install it now:
script/plugin install http://continuous.rubyforge.org/svn/tags/view_test-0.10.0
David Chelimsky asked me the other day if view_test allowed you to write view tests without having created your controller yet. I said yes naively. Last night I fired up the MacBook Pro and looked over my specs to see if I had tested that case (I thought I did), but I didn’t so I wrote a failing spec and then implemented it.
You can now create a view test and create the correct app/views/products directory structure and have it work without having to have a ProductsController in existance. (Examples are in Behaviors format)
1 2 3 4 5 6 7 8 |
class ProductsShowTest < Rails::ViewTest::TestCase should "display hello world when rendering products/show.html.erb" do render :file => "products/show" assert_select 'hello world' end end |
So, David, I didn’t lie on purpose, and hopefully this release will redeem my answer! Enjoy!



4 comments
Jump to comment form | comments rss [?]