Skip to content

Commit

Permalink
Revert to previous webrat gem version.
Browse files Browse the repository at this point in the history
request_spec.feature
  • Loading branch information
justinko committed Aug 28, 2010
1 parent 2ddb077 commit 1752cfe
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -12,7 +12,7 @@ gem 'rspec', :path => "../rspec"
gem 'cucumber'
gem 'aruba', ">= 0.2.0", :require => nil
gem 'jeweler'
gem 'webrat', ">= 0.7.2.beta.1"
gem 'webrat', '0.7.1'
gem 'sqlite3-ruby', :require => 'sqlite3'

case RUBY_VERSION
Expand Down
2 changes: 1 addition & 1 deletion features/controller_specs/isolation_from_views.feature
@@ -1,6 +1,6 @@
Feature: do not render views

By default, controller specs do not render views. This allows you specify
By default, controller specs do not render views. This allows you to specify
which view template an action should try to render regardless of whether or
not the template compiles cleanly.

Expand Down
41 changes: 41 additions & 0 deletions features/request_specs/request_spec.feature
@@ -0,0 +1,41 @@
Feature: request spec

Request specs allow you to spec the interaction of your
Rails application across multiple controllers. This is generally
known as "full stack" testing.

RSpec provides two matchers that delegate to Rails assertion methods:

"render_template" (delegated to assert_template)
"redirect_to" (delegated to assert_redirected_to)

Please check the Rails documentation for options on these methods.

Also, if you would like to use webrat or capybara with your request
specs, all you have to do is include one of them in your Gemfile and
RSpec will automatically load them.

Scenario: specify managing a Widget with Rails integration methods
Given a file named "spec/requests/widget_management_spec.rb" with:
"""
require "spec_helper"
describe "Widget management" do
it "creates a Widget and redirects to the Widget's page" do
get "/widgets/new"
response.should render_template(:new)
post "/widgets", :widget => {:name => "My Widget"}
response.should redirect_to(assigns(:widget))
follow_redirect!
response.should render_template(:show)
response.body.should include("Widget was successfully created.")
end
end
"""
When I run "rspec spec/requests/widget_management_spec.rb"
Then the output should contain "1 example, 0 failures"

0 comments on commit 1752cfe

Please sign in to comment.