local_petition.feature 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. @javascript
  2. Feature: Users petition an institution
  3. Background:
  4. Given a local organizing campaign
  5. And the local organizing campaign has multiple institutions
  6. Scenario: Users should be able to sign a local organizing petition on behalf of their school
  7. When I browse to the action page
  8. And I select "University of Wherever 1" from "Institution"
  9. And I select "Student" from "Affiliation type"
  10. And I click "Add another"
  11. And I select "University of Wherever 2" from "Institution" within ".nested-fields:nth-child(2)"
  12. And I select "Parent" from "Affiliation type" within ".nested-fields:nth-child(2)"
  13. And I fill in my name
  14. And I fill in my email
  15. And I submit the petition
  16. And I reload the page
  17. Then I should see "Student" within "#signatures"
  18. And I should see "University Of Wherever 1" within "#signatures"
  19. And I should see "Parent" within "#signatures"
  20. And I should see "University Of Wherever 2" within "#signatures"
  21. And I should not see "US" within "#signatures"
  22. Scenario: Users must input complete affiliation/relationship pairs
  23. When I browse to the action page
  24. And I select "Student" from "Affiliation type"
  25. And I click "Add another"
  26. And I select "University of Wherever 2" from "Institution" within ".nested-fields:nth-child(2)"
  27. And I click "Add another"
  28. Then "Institution" should be required within ".nested-fields:nth-child(1)"
  29. And "Affiliation type" should be required within ".nested-fields:nth-child(2)"
  30. And "Institution" should not be required within ".nested-fields:nth-child(3)"
  31. And "Affiliation type" should not be required within ".nested-fields:nth-child(3)"
  32. Scenario: Local organizing petitions should show all signatures
  33. Given the petition has 100 signatures with affiliations
  34. When I browse to the action page
  35. Then I should see "Next" within "#signatures"
  36. And I should not see "Download CSV"
  37. Scenario: Local organizing petitions filtered by institution should allow csv download
  38. Given the petition has 100 signatures with affiliations
  39. When I filter the action page by institution
  40. Then I should see "Next" within "#signatures"
  41. And I should see "Download CSV"
  42. When I click "Download CSV"
  43. Then I should receive a CSV file
  44. Scenario: Filtered local petitions should have the chosen institution preselected
  45. Given the petition has 100 signatures with affiliations
  46. When I filter the action page by institution
  47. Then the institution should be selected in the filter