Skip to content

Instantly share code, notes, and snippets.

@snoblenet
Created January 20, 2010 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snoblenet/282274 to your computer and use it in GitHub Desktop.
Save snoblenet/282274 to your computer and use it in GitHub Desktop.
Scenario: view part index
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
When I am at the "Projects" page
And I follow "Shower system"
And I follow "Browse Parts"
Then the main heading should be "Browse Parts"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Browse Parts"
And the current project should be "Shower system"
And the current action should be "Browsing all the parts within “Shower system"
Scenario: new part
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
When I am at the "Projects" page
And I follow "Shower system"
And I follow "Browse Parts"
And I follow "New Part"
Then the main heading should be "New Part"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "New Part"
Scenario: view part
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
When I am at the "Projects" page
And I follow "Shower system"
And I follow "Browse Parts"
And I follow "Plumbing"
Then the main heading should be "Shower system"
And a heading should be "Plumbing"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Show Part"
Scenario: opens a project with extra parts defined and deletes a part
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "Shower system that traps water while heating"
And I follow "Browse Parts"
And I follow "Plumbing"
And I follow "Delete"
Then the main heading should be "Shower system that traps water while heating"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Browse Parts"
And I should see "Success!"
Scenario: opens a project with extra parts defined, and can’t delete the project as a whole
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "Shower system that traps water while heating"
And I follow "Browse Parts"
When I follow "Project As A Whole"
Then the main heading should be "Shower system that traps water while heating"
And a heading should be "Project as a whole"
And I should not see "Delete Part"
Scenario: opens a project with extra parts defined, and can’t edit the project as a whole
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "Shower system that traps water while heating"
And I follow "Browse Parts"
When I follow "Project As A Whole"
Then the main heading should be "Shower system that traps water while heating"
And a heading should be "Project as a whole"
And I should not see "Edit Part"
Scenario Outline: user makes a valid attempt to create a part
Given a range of projects, parts, solutions and images exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "shower system that traps water while heating"
When I follow "Browse Parts"
And I follow "New Part"
And I fill in "projectpart[name]" with "Exterior design"
And I select "<parent>" from the parent menu
And I fill in "projectpart[description]" with "The look and feel of the exterior, assuming the interior is a 10cm cube."
And I press "Save"
Then the main heading should be "Shower system"
And a heading should be "Exterior design"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Show Part"
And I should see "The look and feel of the exterior, assuming the interior is a 10cm cube."
And I should see "<notice>"
And I should see "Show Part"
And I should see "Success!"
Scenarios: user makes a valid attempt to create a part
| parent | notice |
| parent_1 | You have created a new part called “Exterior design” within the project called “Shower system that traps water while heating”. |
| parent_5 | You have created a new part called “Exterior design” within the part called “Shower Head”. |
| parent_6 | You have created a new part called “Exterior design” within the part called “Plumbing”. |
| parent_7 | You have created a new part called “Exterior design” within the part called “Outer Head”. |
| parent_8 | You have created a new part called “Exterior design” within the part called “Inner Head”. |
Scenario: user creates several parts at the root level of a project
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "shower system that traps water while heating"
When I follow "Browse Parts"
And I follow "New Part"
And I fill in "projectpart[name]" with "Exterior design"
And I fill in "projectpart[description]" with "The look and feel of the exterior, assuming the interior is a 10cm cube."
And I press "Save"
And I follow "Browse Parts"
And I follow "New Part"
And I fill in "projectpart[name]" with "Interior design"
And I fill in "projectpart[description]" with "The look and feel of the interior, assuming the exterior surrounds a 10cm cube."
And I press "Save"
Then the main heading should be "Shower system"
And a heading should be "Interior design"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Show Part"
And I should see "The look and feel of the interior, assuming the exterior surrounds a 10cm cube."
And I should see "Success!"
And I should see "You have created a new part called “Interior design” within the project called “Shower system that traps water while heating”."
And I should see "Show Part"
Scenario Outline: user creates an invalid part -- and sees appropriate text
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "shower system that traps water while heating"
And I follow "Browse Parts"
When I follow "New Part"
And I fill in "projectpart[name]" with "Wind-powered fridge"
And I fill in "projectpart[description]" with "It’s a fridge"
And I press "Save"
And I follow "Browse Parts"
And I follow "New Part"
And I fill in "projectpart[name]" with "<name>"
And I fill in "projectpart[description]" with "<description>"
And I press "Save"
Then the main heading should be "New Part"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "New Part"
And I should see "<notice>"
And I should not see "Success!"
Scenarios: user enters an invalid part -- and sees appropriate text
| name | description | notice |
| Wind-powered fridge | It’s a fridge | There’s already a part within this project with that name |
| Solar-powered fridge with racing stripes, cup holders and broadband access | It’s a fridge | use no more than 50 characters |
| Solar-powered fridge | It’s a fridge. It’s wind-powered and it has racing stripes, cup holders and broadband access. There’s so much I could say about this fridge that I’m not sure how to say it all now. There’s so much I want to say. So much. So very very much. | use no more than 200 characters |
|| It’s a fridge | Please enter a name |
| Solar-powered fridge || Please enter a description |
| #.#.#. | It’s a fridge | This part’s name must contain at least one letter from A to Z. |
Scenario: opens a project, selects a part and starts the editing process
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
When I am at the "Projects" page
And I follow "Shower system"
And I follow "Browse Parts"
And I follow "Plumbing"
And I follow "Edit Part"
Then the main heading should be "Shower system"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Edit Part"
Scenario: opens a project, selects a part and makes valid edits
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "Shower system that traps water while heating"
And I follow "Browse Parts"
And I follow "Plumbing"
And I follow "Edit Part"
When I fill in "name" with "Front door"
And I fill in "description" with "The thing that you open"
And I press "Save"
Then the main heading should be "Shower system"
And a heading should be "Front door"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Show Part"
And I should see "Success!"
And I should see "You have updated the part called “Front door”."
Scenario Outline: opens a project, selects a part and makes invalid edits
Given a project, part, solution and image exist
And a user called "Droboy" is logged in
And I am at the "Projects" page
And I follow "shower system that traps water while heating"
And I follow "Browse Parts"
When I follow "New Part"
And I fill in "projectpart[name]" with "Wind-powered fridge"
And I fill in "projectpart[description]" with "It’s a fridge"
And I press "Save"
And I follow "New Part"
And I fill in "projectpart[name]" with "Sun-powered fridge"
And I fill in "projectpart[description]" with "It’s also a fridge"
And I press "Save"
And I follow "Edit Part"
And I fill in "projectpart[name]" with "<name>"
And I fill in "projectpart[description]" with "<description>"
And I press "Save"
Then I should see "<notice>"
And the breadcrumbs should include "This Project"
And the final breadcrumb should be "Edit Part"
And I should not see "Success!"
Scenarios: opens a project, selects a part and makes invalid edits
| name | description | notice |
| Wind-powered fridge | It’s a fridge | There’s already a part within this project with that name |
| Solar-powered fridge with racing stripes, cup holders and broadband access | It’s a fridge | use no more than 50 characters |
| Solar-powered fridge | It’s a fridge. It’s wind-powered and it has racing stripes, cup holders and broadband access. There’s so much I could say about this fridge that I’m not sure how to say it all now. There’s so much I want to say. So much. So very very much. | use no more than 200 characters |
|| It’s a fridge | Please enter a name |
| Solar-powered fridge || Please enter a description |
| #.#.#. | It’s a fridge | This part’s name must contain at least one letter from A to Z. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment