Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rails integration testing support

  • Loading branch information...
commit 59ac58020dd7cac45d14443d03debb194fe041e8 1 parent fe28141
@cavalle authored
View
2  README.md
@@ -42,7 +42,7 @@ If, after all, this is just RSpec + Capybara, why does Steak even exist? Do I re
Basically Steak exists for three reasons:
1. **Making a point**. First of all, Steak proposes that using RSpec and Capybara for acceptance testing is a sensible alternative to Cucumber. It also sets a name to refer to that approach.
-1. **Adding convenience**. As a gem, Steak aims to make the experience as convenient as possible. It provides several Rails generators and Rake tasks so that setting up a new project or creating and running specs are quick and seamless tasks. A natural extension of RSpec-Rails.
+1. **Adding convenience**. As a gem, Steak aims to make the experience as convenient as possible. It provides Rails integration testing support and several generators and rake tasks so that setting up a new project or creating and running specs are quick and seamless tasks. A natural extension of RSpec-Rails.
1. **Building a community**. No development approach or ruby gem is really valuable without an active community behind it. The mailing list, the IRC channel, the wiki or the twitter account are useful tools to build a community of users that help each other by sharing knowledge, resources and best practices.
## Getting Started
View
1  lib/steak/acceptance_example_group.rb
@@ -3,6 +3,7 @@ module AcceptanceExampleGroup
extend ActiveSupport::Concern
included do
+ include RSpec::Rails::RequestExampleGroup
metadata[:type] = :acceptance
end
end
View
20 spec/acceptance/creating_specs_spec.rb
@@ -51,5 +51,25 @@
output.should =~ /1 example, 0 failures/
end
+
+ scenario 'with Rails integration testing support' do
+ new_project_from :rails_project_with_steak
+
+ create_file 'spec/acceptance/integration_spec.rb', <<-RSPEC
+ require 'acceptance/acceptance_helper'
+
+ feature 'Capybara and paths' do
+ scenario 'should visit homepage' do
+ get '/'
+
+ status.should == 200
+ end
+ end
+ RSPEC
+
+ run 'rspec spec/acceptance/integration_spec.rb'
+
+ output.should =~ /1 example, 0 failures/
+ end
end
View
2  spec/spec_helper.rb
@@ -2,6 +2,6 @@
require 'bundler/setup'
require 'rails'
-require 'steak'
+require 'capybara/rspec/features'
require 'support/helpers'
Please sign in to comment.
Something went wrong with that request. Please try again.