Browse files

doc tweaks

- Closes #305.
  • Loading branch information...
1 parent b8422df commit d9dc1fde156ced5cebf89e214ac1a65e7da427c2 @dchelimsky dchelimsky committed Jan 15, 2011
Showing with 22 additions and 0 deletions.
  1. +2 −0 Gemfile
  2. +16 −0 features/
  3. +4 −0 lib/rspec/rails/mocks.rb
@@ -9,6 +9,8 @@ source ""
+gem "arel", :path => "~/projects/ruby/arel"
gem "rake", "0.8.7"
gem "cucumber", "0.10.0"
gem "aruba", "0.2.2"
@@ -54,3 +54,19 @@ fix releases in RSpec). Part of the philosophy of rspec-rails-2 is to rely on
public APIs in Rails as much as possible. In this case, `render_template`
delegates directly to Rails' `assert_template`, which only works after the
+## View specs
+### No more `have_tag`
+Before Webrat came along, rspec-rails had its own `have_tag` matcher that
+wrapped Rails' `assert_select`. Webrat included a replacement for `have_tag` as
+well as new matchers (`have_selector` and `have_xpath`), all of which rely on
+Nokogiri to do its work, and are far less brittle than RSpec's `have_tag`.
+Capybara has similar matchers, which will soon be available view specs (they
+are already available in controller specs with `render_views`).
+Given the brittleness of RSpec's `have_tag` matcher and the presence of new
+Webrat and Capybara matchers that do a better job, `have_tag` was not included
+in rspec-rails-2.
@@ -27,6 +27,10 @@ def destroy
self.stub(:id) { nil }
+ def [](key)
+ send(key)
+ end
def new_record?

3 comments on commit d9dc1fd

At, you referenced this fix for a problem with the have_text? matcher, but I see that you have updated the docs for the have_tag? matcher instead. Can you add information about have_text? and what the recommended replacement for it is?



dchelimsky replied Apr 16, 2011

See d3f5e0b

Please sign in to comment.