diff options
| author | mo khan <mo@mokhan.ca> | 2016-04-23 10:27:53 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2016-04-23 10:27:53 -0600 |
| commit | 0ba8da446d39f0715d31bdeb22418327775efe81 (patch) | |
| tree | be3afa73851e2b8bedcfb4bbae66756d4ea9df53 | |
| parent | f33a1a9f003bc7253973889ed7038d3fe6c2ae74 (diff) | |
use table of examples.
| -rw-r--r-- | features/registration.feature | 9 | ||||
| -rw-r--r-- | features/step_definitions/registration_steps.rb | 13 |
2 files changed, 16 insertions, 6 deletions
diff --git a/features/registration.feature b/features/registration.feature index 6229d5e..3cef589 100644 --- a/features/registration.feature +++ b/features/registration.feature @@ -3,7 +3,12 @@ Feature: Registration As a new visitor I want to register for an account to gain access to the website. - Scenario: Register a new user + Scenario Outline: Register a new user Given the user is on the registration page - When they enter a username, email and password + When they enter a <username>, <email> and <password> Then it should take them to the dashboard + + Examples: + | username | email | password | + | mo | mo@example.org | password | + | joe | joe@example.org | the secret | diff --git a/features/step_definitions/registration_steps.rb b/features/step_definitions/registration_steps.rb index 5d10535..be9d821 100644 --- a/features/step_definitions/registration_steps.rb +++ b/features/step_definitions/registration_steps.rb @@ -1,12 +1,17 @@ -Given /the user is on the registration page/ do +Given /^the user is on the registration page$/ do @subject = NewRegistrationPage.new @subject.visit_page end -When /they enter a username, email and password/ do - @subject.register_with(username: "mo", email: "mo@example.com", password: "password") +When /^they enter a (.*), (.*) and (.*)$/ do |username, email, password| + puts [username, email, password].inspect + @subject.register_with( + username: username, + email: email, + password: password + ) end -Then /it should take them to the dashboard/ do +Then /^it should take them to the dashboard$/ do expect(@subject.current_path).to eql(dashboard_path) end |
