Navigation Menu

Skip to content

Commit

Permalink
doc tweaks
Browse files Browse the repository at this point in the history
- Closes rspec#305.
  • Loading branch information
dchelimsky committed Jan 15, 2011
1 parent b8422df commit d9dc1fd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -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"
Expand Down
16 changes: 16 additions & 0 deletions features/Upgrade.md
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions lib/rspec/rails/mocks.rb
Expand Up @@ -27,6 +27,10 @@ def destroy
self.stub(:id) { nil }
end

def [](key)
send(key)
end

def new_record?
!persisted?
end
Expand Down

0 comments on commit d9dc1fd

Please sign in to comment.