Skip to content

Commit

Permalink
Rails integration testing support
Browse files Browse the repository at this point in the history
  • Loading branch information
cavalle committed Jun 5, 2011
1 parent fe28141 commit 59ac580
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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: 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. **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. 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 ## Getting Started
Expand Down
1 change: 1 addition & 0 deletions lib/steak/acceptance_example_group.rb
Expand Up @@ -3,6 +3,7 @@ module AcceptanceExampleGroup
extend ActiveSupport::Concern extend ActiveSupport::Concern


included do included do
include RSpec::Rails::RequestExampleGroup
metadata[:type] = :acceptance metadata[:type] = :acceptance
end end
end end
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/creating_specs_spec.rb
Expand Up @@ -51,5 +51,25 @@


output.should =~ /1 example, 0 failures/ output.should =~ /1 example, 0 failures/
end 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 end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -2,6 +2,6 @@
require 'bundler/setup' require 'bundler/setup'


require 'rails' require 'rails'
require 'steak' require 'capybara/rspec/features'


require 'support/helpers' require 'support/helpers'

0 comments on commit 59ac580

Please sign in to comment.