Skip to content
Browse files

update history/upgrade w/ info about stub_template

  • Loading branch information...
1 parent 55acd0f commit 012fd2294124054ecab0665ffa3f337681eff108 @dchelimsky dchelimsky committed Nov 22, 2010
Showing with 17 additions and 4 deletions.
  1. +3 −0 History.md
  2. +14 −4 Upgrade.markdown
View
3 History.md
@@ -4,6 +4,9 @@
[full changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...master)
+* Enhancements
+ * Added stub_template in view specs
+
* Bug fixes
* Properly include helpers in views (Jonathan del Strother)
* Fix bug in which method missing led to a stack overflow
View
18 Upgrade.markdown
@@ -22,17 +22,27 @@ trade-off.
## View specs
+### view.should render_template
+
Rails changed the way it renders partials, so to set an expectation that a
-partial gets rendered:
+partial gets rendered, you need
render
view.should render_template(:partial => "widget/_row")
-## as_new_record
+### stub_template
+
+Introduced in rspec-rails-2.2, simulates the presence of view templates on the
+file system. This supports isolation from partials rendered by the vew template
+that is the subject of a view example:
+
+ stub_template "widgets/_widget.html.erb" => "This Content"
+
+### as_new_record
Earlier versions of the view generators generated stub_model with `:new_record?
-=> true`. As of rspec-rails-2.0.0.rc, that is no longer recognized, so you need
-to change this:
+=> true`. That is no longer recognized in rspec-rails-2, so you need to change
+this:
stub_model(Widget, :new_record? => true)

0 comments on commit 012fd22

Please sign in to comment.
Something went wrong with that request. Please try again.