From 09fc035c4e9dd47151c1706bdfee30cc5298c842 Mon Sep 17 00:00:00 2001 From: dasolyoon Date: Wed, 23 Nov 2016 23:23:47 -0800 Subject: [PATCH] added disc features (#80) --- features/admins/add_discussions.feature | 35 ++++++++++++++++++------ features/admins/edit_discussions.feature | 25 +++++++++++++++++ 2 files changed, 52 insertions(+), 8 deletions(-) create mode 100644 features/admins/edit_discussions.feature diff --git a/features/admins/add_discussions.feature b/features/admins/add_discussions.feature index ceaa1374..d5db84b9 100644 --- a/features/admins/add_discussions.feature +++ b/features/admins/add_discussions.feature @@ -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 "supreme_ruler@aol.com" + 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" - \ No newline at end of file + 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 diff --git a/features/admins/edit_discussions.feature b/features/admins/edit_discussions.feature new file mode 100644 index 00000000..ec1664d4 --- /dev/null +++ b/features/admins/edit_discussions.feature @@ -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 "supreme_ruler@aol.com" + + 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"