<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h1&gt;Story: User management&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;As an administrator&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I want to manage users&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;So that I can give or revoke access to people&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario: creating a new user, adding a planner role and removing it&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;
Given the user with username 'Administrator' is logged in

When he clicks the 'Admin' link
And he clicks the 'Users' link
And he clicks the 'Add a new user' link
And he fills the 'Username' field with 'Dummy'
And he fills the 'Password' field with '123'
And he fills the 'Confirm Password' field with '123'
And he clicks the button

Then a user with username 'Dummy' should exist

When he selects 'Planner'
And he clicks the button

Then the user with username 'Dummy' should be planner

When he clicks the destroy link
And he confirms the popup
Then the user with username 'Dummy' should not be planner
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Scenario: Editing a user, giving him a role, and logging in as that user&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
Given the user with username &amp;#8216;Administrator&amp;#8217; is logged in&lt;br /&gt;
And a user with username &amp;#8216;Dummy&amp;#8217; exists&lt;br /&gt;
And it has password &amp;#8216;123&amp;#8217;&lt;/p&gt;
&lt;p&gt;When he clicks the &amp;#8216;Admin&amp;#8217; link&lt;br /&gt;
And he clicks the &amp;#8216;Users&amp;#8217; link&lt;br /&gt;
And he clicks the show link for the user with username &amp;#8216;Dummy&amp;#8217;&lt;br /&gt;
And he clicks the &amp;#8216;Edit user&amp;#8217; link&lt;/p&gt;
&lt;p&gt;And he fills the &amp;#8216;Username&amp;#8217; field with &amp;#8216;Changed dummy&amp;#8217;&lt;br /&gt;
And he clicks the button&lt;/p&gt;
&lt;p&gt;When he clicks the &amp;#8216;Change password&amp;#8217; link&lt;br /&gt;
And he fills the &amp;#8216;New password&amp;#8217; field with &amp;#8216;new&amp;#8217;&lt;br /&gt;
And he fills the &amp;#8216;Confirm new password&amp;#8217; field with &amp;#8216;new&amp;#8217;&lt;br /&gt;
And he clicks the button&lt;/p&gt;
&lt;p&gt;When he selects &amp;#8216;Planner&amp;#8217;&lt;br /&gt;
And he clicks the button&lt;/p&gt;
&lt;p&gt;Given he logs out&lt;br /&gt;
And the user &amp;#8216;Changed dummy&amp;#8217; logs in with password &amp;#8216;new&amp;#8217;&lt;/p&gt;
&lt;p&gt;Then he should see the word &amp;#8216;Welcome&amp;#8217;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario: A user without any roles&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;
Given a user with username 'Dummy' exists
And the user with username 'Dummy' has password 'monkey'
And the user 'Dummy' logs in with password 'monkey'

Then he should see the word 'Unauthorized'
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Scenario: A user should not be able to login with wrong password&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;/p&gt;
&lt;p&gt;Given a user with username &amp;#8216;Dummy&amp;#8217; exists&lt;br /&gt;
And the user with username &amp;#8216;Dummy&amp;#8217; has password &amp;#8216;monkey&amp;#8217;&lt;/p&gt;
&lt;p&gt;Then the user &amp;#8216;Dummy&amp;#8217; should not be able to log in with password &amp;#8216;123&amp;#8217;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario: Trying to destroy the administrator should fail&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;
Given the user with username 'Administrator' is logged in

When he clicks the 'Admin' link
And he clicks the 'Users' link
And he clicks the show link for the user with username 'Administrator'

Then he should not see the word 'Edit user'
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Scenario: Trying to remove the administrator role from nedap the administrator should fail&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
Given the user with username &amp;#8216;Administrator&amp;#8217; is logged in&lt;/p&gt;
&lt;p&gt;When he clicks the &amp;#8216;Admin&amp;#8217; link&lt;br /&gt;
And he clicks the &amp;#8216;Users&amp;#8217; link&lt;br /&gt;
And he clicks the show link for the user with username &amp;#8216;Administrator&amp;#8217;&lt;/p&gt;
&lt;p&gt;Then he should not see the word &amp;#8216;Destroy&amp;#8217;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario: Hidden users should only be visible to the nedap administrator&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;
Given the user with username 'Administrator' is logged in
And a user with username 'Dummy' exists
And the user with username 'Dummy' has a responsibility for the role with name 'Administrator'

When he clicks the 'Admin' link
And he clicks the 'Users' link

Then he should see the words 'installtest','ioconcept','Administrator' and 'Dummy'

Given he logs out
And the user 'Dummy' logs in with password '123'

When he clicks the 'Admin' link
And he clicks the 'Users' link

Then he should not see the words 'installtest' and 'ioconcept'
And he should see the words 'Administrator' and 'Dummy'
&lt;/pre&gt;</body>
  <created-at type="datetime">2008-08-19T05:05:29-07:00</created-at>
  <id type="integer">46804</id>
  <permalink>example-story-2</permalink>
  <repository-id type="integer">43898</repository-id>
  <title>Example story #2</title>
  <updated-at type="datetime">2008-08-19T10:33:35-07:00</updated-at>
  <user-id type="integer">13864</user-id>
</wiki>
