From: Jan Provaznik <jprov...@redhat.com>

---
 src/features/authentication.feature             |   18 ++++++++++++++++++
 src/features/step_definitions/authentication.rb |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/features/authentication.feature 
b/src/features/authentication.feature
index 12e217b..2527c64 100644
--- a/src/features/authentication.feature
+++ b/src/features/authentication.feature
@@ -21,6 +21,24 @@ Feature: User authentication
     And I should see "User registered!"
     And I should have one private pool named "testuser"
 
+  @register
+  Scenario: Register as new user fails even if user is valid
+    Given I am on the homepage
+    And there are not any roles
+    When I follow "Create one now"
+    Then I should be on the new account page
+    And I should see "New Account"
+    When I fill in the following:
+      | Choose a username | testuser             |
+      | Choose a password | secret               |
+      | Confirm password  | secret               |
+      | First name        | Joe                  |
+      | Last name         | Tester               |
+      | Email             | testu...@example.com |
+    And I press "Create Account"
+    Then I should see "New Account"
+    And I should see "user registration failed"
+
   Scenario: Log in as registered user
     Given I am a registered user
     And I am on the login page
diff --git a/src/features/step_definitions/authentication.rb 
b/src/features/step_definitions/authentication.rb
index c0d581d..0c72146 100644
--- a/src/features/step_definitions/authentication.rb
+++ b/src/features/step_definitions/authentication.rb
@@ -23,6 +23,10 @@ Given /^I am logged in$/ do
   UserSession.find.should_not == nil
 end
 
+Given /^there are not any roles$/ do
+  Role.destroy_all
+end
+
 When /^I forget to enter my password$/ do
   login(user.login, nil)
 end
-- 
1.7.0.1

_______________________________________________
deltacloud-devel mailing list
deltacloud-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to