It won&#x2019;t because the test code was testing create_widget, not create
Offload the work to someone else. He behaves like a user and finds problems the user would find.
He certainly would
Probably not, the QA guy typically only checks new features and will do a regression test every month or so.
Came out of work at Thoughtworks. Works on all platforms with all browsers and a ton of languages have clients
Is your QA guy going to learn a full on programming language?
There&#x2019;s a lot here and your QA guy isn&#x2019;t going to learn it all
This doesn&#x2019;t seem too good. We&#x2019;d much rather have QA / business involved (and hopefully even doing the work).
Scenario tells what we&#x2019;re testing
Given sets up assumptions about your Scenario
When performs actions
And duplicates whatever came before
Then is your assertion
And let&#x2019;s see this run in cucumber
90% of what you do is click a link, fill in text, and assert that text is present. Webrat handles these for you.
Add your own step definitions in features/step_definitions/*.rb. There are some step_definitions your QA guy can&#x2019;t implement and you&#x2019;ll have to help.
Features go at the top level. Steps definitions go in step_definitions. Support files go in support. Cucumber will load everything.
Writing cucumber features can be time consuming. Cuke-talker is a command line IDE for writing them.
cuke-talker isn&#x2019;t even close to done. We&#x2019;re looking for help (yay open source!)
Given, When, Then, And behave just like they do in cucumber ! lets you execute arbitrary ruby define step opens a subrepel for defining a step feature will run a feature file from your features dir (will soon be run feature) show history shows all your previous Given, When, Then, Ands show step definitions shows all the steps you&#x2019;ve defined
Unit Tests Aren't Enough
Unit Tests Aren’t Enough
and your QA guy can’t regression test for you...
Will this test save you?
With this code?
<%= form_for :widget %>
<%= submit_tag “Create” %>
<% end %>
def create; puts “doing nothing”; end
Scenario: Searching on Google # features/google_search.feature:6
Given I am on the homepage # features/step_deﬁnitions/webrat_steps.rb:6
When I ﬁll in "q" with "cukes" # features/step_deﬁnitions/webrat_steps.rb:29
And I press "Google Search" # features/step_deﬁnitions/webrat_steps.rb:17
Then I should see "cukes.info" # features/step_deﬁnitions/webrat_steps.rb:121
1 scenario (1 passed)
4 steps (4 passed)