Skip to content

Commit

Permalink
added disc features (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
dasolyoon authored Nov 24, 2016
1 parent 77722c1 commit 09fc035
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
35 changes: 27 additions & 8 deletions features/admins/add_discussions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,33 @@ Feature: admin adds discussion times
| Bob | supreme_ruler@aol.com | ilikcats |
And I am on the login page
And I log in as an admin with email "[email protected]"
And I am on the new discussion page

Scenario: Admin successfully adds a new discussion
Given I am on the new discussion page
When I fill in "ccn" with "12345"
Given I fill in "ccn" with "12345"
And I select "Monday" from "day"
And I fill in "time" with "3pm"
And I fill in "capacity" with "20"
And I press "Add Discussion"
Then I should see "Discussion Sections"
And I should see "12345 Monday 3pm 20"

And PENDING: I choose "3PM" from "time"
And PENDING: I fill in "capacity" with "20"
And PENDING: I press "Add Discussion"
Then PENDING: I should see "Discussion Sections"
And PENDING: I should see "12345 Monday 3pm 20"

Scenario: Admin prevented from adding a discussion with an already-existing CCN
Given the following discussions exist
| number | time | capacity |
| 54321 | Tues, 3pm | 25 |
And PENDING: I fill in "ccn" with "54321"
And PENDING: I select "Monday" from "day"
And PENDING: I choose "3PM" from "time"
And PENDING: I fill in "capacity" with "20"
And PENDING: I press "Add Discussion"
Then PENDING: I should see "This discussion already exists"

Scenario: Admin fails to create a new discussion
Given PENDING: I fill in "ccn" with "Elmo's World"
And PENDING: I select "Monday" from "day"
And PENDING: I choose "3PM" from "time"
And PENDING: I fill in "capacity" with "Nananana"
And PENDING: I press "Add Discussion"
Then PENDING: I should see "Unable to create discussion"
And PENDING: I should be on the new_discussion page
25 changes: 25 additions & 0 deletions features/admins/edit_discussions.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Feature: admin edits discussion times
As an admin
In order to account for course changes
I want to edit discussion times and capacities

Background:
Given the following admins exist
| name | email | password |
| Bob | supreme_ruler@aol.com | ilikcats |
And the following discussions exist
| number | time | capacity |
| 54321 | Tues, 3pm | 25 |
And I am on the login page
And I log in as an admin with email "[email protected]"

Scenario: Admin successfully edits a discussion
Given I am on the discussion_index page
Then I should see "54321 Tues, 3pm 25"
When PENDING: I press "edit_1"
And PENDING: I select "Monday" from "day"
And PENDING: I fill in "time" with "4pm"
And PENDING: I fill in "capacity" with "10"
And PENDING: I press "Make Changes"
Then PENDING: I should see "Discussion Sections"
And PENDING: I should see "54321 Monday 4pm 10"

0 comments on commit 09fc035

Please sign in to comment.