Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

doc tweaks

- Closes #305.
  • Loading branch information...
commit d9dc1fde156ced5cebf89e214ac1a65e7da427c2 1 parent b8422df
@dchelimsky dchelimsky authored
Showing with 22 additions and 0 deletions.
  1. +2 −0  Gemfile
  2. +16 −0 features/Upgrade.md
  3. +4 −0 lib/rspec/rails/mocks.rb
View
2  Gemfile
@@ -9,6 +9,8 @@ source "http://rubygems.org"
end
end
+gem "arel", :path => "~/projects/ruby/arel"
+
gem "rake", "0.8.7"
gem "cucumber", "0.10.0"
gem "aruba", "0.2.2"
View
16 features/Upgrade.md
@@ -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
action.
+
+## 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.
View
4 lib/rspec/rails/mocks.rb
@@ -27,6 +27,10 @@ def destroy
self.stub(:id) { nil }
end
+ def [](key)
+ send(key)
+ end
+
def new_record?
!persisted?
end
Please sign in to comment.
Something went wrong with that request. Please try again.