Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 108 lines (70 sloc) 4.514 kb
718450f Steve Richert Fix build status and add dependency status to README
laserlemon authored
1 # Steak [![Build Status](https://secure.travis-ci.org/cavalle/steak.png)](http://travis-ci.org/cavalle/steak) [![Dependency Status](https://gemnasium.com/cavalle/steak.png)](https://gemnasium.com/cavalle/steak)
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
2
3 The delicious combination of RSpec and Capybara for Acceptance BDD
4
5 ![Steak!!](http://dl.dropbox.com/u/645329/steak_small.jpg "Steak!!")
6
7 ## What is Steak?
8
9a10a46 Victor Fixed a minor spelling error in README.md
MPV authored
9 Steak is a minimal extension of RSpec-Rails that adds several conveniences to do acceptance testing of Rails applications using Capybara. It's an alternative to Cucumber in plain Ruby. This is how an acceptance spec looks like in Steak:
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
10
2ca42a7 Luismi Cavallé Remove whitespaces and replace double quotes with single quotes were pos...
authored
11 feature 'Main page' do
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
12
13 background do
2ca42a7 Luismi Cavallé Remove whitespaces and replace double quotes with single quotes were pos...
authored
14 create_user :login => 'jdoe'
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
15 end
16
2ca42a7 Luismi Cavallé Remove whitespaces and replace double quotes with single quotes were pos...
authored
17 scenario 'should show existing quotes' do
18 create_quote :text => 'The language of friendship is not words, but meanings',
19 :author => 'Henry David Thoreau'
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
20
2ca42a7 Luismi Cavallé Remove whitespaces and replace double quotes with single quotes were pos...
authored
21 login_as 'jdoe'
22 visit '/'
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
23
2ca42a7 Luismi Cavallé Remove whitespaces and replace double quotes with single quotes were pos...
authored
24 within('.quote') do
25 page.should have_content('The language of friendship is not words, but meanings')
26 page.should have_content('Henry David Thoreau')
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
27 end
28 end
29
30 end
31
32 No givens, whens or thens. No steps, no english, just Ruby. The delicious combination of RSpec and Capybara. That's Steak!
33
34 ## Why Steak?
35
36 If, after all, this is just RSpec + Capybara, why does Steak even exist? Do I really need it?
37
38 Basically Steak exists for three reasons:
39
40 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.
59ac580 Luismi Cavallé Rails integration testing support
authored
41 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.
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
42 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.
43
44 ## Getting Started
45
7f7221e Luismi Cavallé Version 2.0.0
authored
46 _NOTE: The current version of Steak (2.0) assumes that you're testing a Rails 3 application, with RSpec 2 and Capybara. For Rails 2, RSpec 1 or Webrat you should use [Steak 1](https://github.com/cavalle/steak/tree/steak-1) (or consider upgrading to non-obsolete technologies ;P)_
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
47
48 It's super-easy to get you started. Just add the gem to your `Gemfile`
49
77d9971 Luismi Cavallé Rake support
authored
50 group :test, :development do
7f7221e Luismi Cavallé Version 2.0.0
authored
51 gem 'steak'
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
52 # ...
53
54 …and then install the gem and run the generator:
55
56 $ bundle
57 $ rails g steak:install
58
ce80502 Luismi Cavallé Updated README for master branch
authored
59 You're now set up! Note that Steak is the only dependency you really need, you can safely remove any reference to `capybara`, `rspec-rails` or `rspec` from your `Gemfile`, they will be included by Steak. Also note that, unless previously executed, Steak will run the RSpec generator so you don't need to invoke it.
60
61 Take a look now at the default directory structure you've got under `spec/acceptance`. It will help you organize the helpers and configurations for your acceptance specs.
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
62
63
64 ## Creating and running specs
65
66 You can create your specs by hand, however you may prefer to use the generator:
67
68 $ rails g steak:spec my_first_feature
69
70 To run your acceptance specs you just do like with any other spec…
71
d991be3 Omar Use bundle exec to run rspec
ovargas27 authored
72 $ bundle exec rspec spec/acceptance/my_first_feature_spec.rb
b39daa3 Luismi Cavallé Steak 2 rewrite driven by a new README
authored
73
74 …or using rake:
75
76 $ rake spec:acceptance
77
78 ## Resources
79
80 * [Source code](http://github.com/cavalle/steak) – Lurking and forking
81 * [Issues](http://github.com/cavalle/steak/issues) – Bugs and feature requests
82 * [Google Group](http://groups.google.com/group/steakrb) & [IRC channel](irc://irc.freenode.net/jenkinsci) – Help and discussion
83 * [Twitter](http://twitter.com/steakrb) – Announcements and mentions
84 * [Wiki](https://github.com/cavalle/steak/wiki) – Tutorials, docs and other resources
85
86 ## Credits
87
88 Steak was created by [Luismi Cavallé](http://lmcavalle.com) and improved thanks to the love from:
89
90 * Álvaro Bautista
91 * Felipe Talavera
92 * Paco Guzmán
93 * Jeff Kreeftmeijer
94 * Jaime Iniesta
95 * Emili Parreño
96 * Andreas Wolff
97 * Wincent Colaiuta
98 * Falk Pauser
99 * Francesc Esplugas
100 * Raúl Murciano
101 * Enable Interactive
102 * Vojto Rinik
103 * Fred Wu
104 * Sergio Espeja
105 * Joao Carlos
106
107 Copyright © 2009 - 2011 Luismi Cavallé, released under the MIT license
Something went wrong with that request. Please try again.