2011-05-24 19:23:05 +00:00
|
|
|
Feature: Manage Contents
|
|
|
|
In order to manage instances from custom content types
|
|
|
|
As an administrator
|
|
|
|
I want to add/edit/delete custom contents of my site
|
|
|
|
|
|
|
|
Background:
|
2011-06-29 01:05:07 +00:00
|
|
|
Given I have the site: "test site" set up
|
2011-06-30 10:41:20 +00:00
|
|
|
And I have a custom model named "Projects" with
|
2011-12-22 23:45:32 +00:00
|
|
|
| label | type | required |
|
2011-06-30 10:41:20 +00:00
|
|
|
| Name | string | true |
|
|
|
|
| Description | text | false |
|
2011-12-22 23:45:32 +00:00
|
|
|
| Category | select | false |
|
2011-06-30 10:41:20 +00:00
|
|
|
And I have "Design, Development" as "Category" values of the "Projects" model
|
2011-06-29 01:05:07 +00:00
|
|
|
And I am an authenticated user
|
2011-06-30 10:41:20 +00:00
|
|
|
And I have entries for "Projects" with
|
|
|
|
| name | description | category |
|
|
|
|
| My sexy project | Lorem ipsum | Development |
|
|
|
|
| Foo project | Lorem ipsum... | Design |
|
|
|
|
| Bar project | Lorem ipsum... | Design |
|
2011-06-29 01:05:07 +00:00
|
|
|
|
2011-06-29 12:00:26 +00:00
|
|
|
Scenario:
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2011-06-29 12:00:26 +00:00
|
|
|
Then I should see "My sexy project"
|
|
|
|
|
|
|
|
Scenario: Add a new entry
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2012-02-29 01:11:56 +00:00
|
|
|
And I follow "new entry"
|
|
|
|
Then I should see "Projects — new entry"
|
2011-06-29 12:00:26 +00:00
|
|
|
When I fill in "Name" with "My other sexy project"
|
|
|
|
And I fill in "Description" with "Lorem ipsum...."
|
|
|
|
And I press "Create"
|
2012-02-29 01:11:56 +00:00
|
|
|
Then I should see "Entry was successfully created."
|
2011-06-29 12:00:26 +00:00
|
|
|
|
|
|
|
Scenario: Add an invalid entry
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2012-02-29 01:11:56 +00:00
|
|
|
And I follow "new entry"
|
2011-06-29 12:00:26 +00:00
|
|
|
And I fill in "Description" with "Lorem ipsum...."
|
|
|
|
And I press "Create"
|
2012-02-29 01:11:56 +00:00
|
|
|
Then I should not see "Entry was successfully created."
|
2011-06-29 12:00:26 +00:00
|
|
|
|
|
|
|
Scenario: Update an existing entry
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2011-06-29 12:00:26 +00:00
|
|
|
And I follow "My sexy project"
|
|
|
|
When I fill in "Name" with "My other sexy project (UPDATED)"
|
2011-07-22 23:26:16 +00:00
|
|
|
And I press "Save"
|
2012-02-29 01:11:56 +00:00
|
|
|
Then I should see "Entry was successfully updated."
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2011-06-29 12:00:26 +00:00
|
|
|
Then I should see "My other sexy project (UPDATED)"
|
2011-05-24 19:23:05 +00:00
|
|
|
|
2011-06-29 12:00:26 +00:00
|
|
|
Scenario: Update an invalid entry
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2011-06-29 12:00:26 +00:00
|
|
|
And I follow "My sexy project"
|
|
|
|
When I fill in "Name" with ""
|
2011-07-22 23:26:16 +00:00
|
|
|
And I press "Save"
|
2012-02-29 01:11:56 +00:00
|
|
|
Then I should not see "Entry was successfully updated."
|
2011-05-24 19:23:05 +00:00
|
|
|
|
2011-06-29 12:00:26 +00:00
|
|
|
Scenario: Destroy an entry
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2012-02-29 01:11:56 +00:00
|
|
|
And I follow "x"
|
|
|
|
Then I should see "Entry was successfully deleted."
|
2011-06-29 21:52:49 +00:00
|
|
|
And I should not see "My sexy project"
|
|
|
|
|
2011-06-30 10:41:20 +00:00
|
|
|
Scenario: Group entries by category
|
2012-03-01 10:07:22 +00:00
|
|
|
When I go to the list of "Projects"
|
2011-06-30 10:41:20 +00:00
|
|
|
Then I should not see "Development"
|
|
|
|
And I should not see "Design"
|
|
|
|
When I change the presentation of the "Projects" model by grouping items by "Category"
|
2012-03-01 10:07:22 +00:00
|
|
|
And I go to the list of "Projects"
|
2011-06-30 10:41:20 +00:00
|
|
|
Then I should see "Development"
|
|
|
|
And I should see "Design"
|