14. Feature: Administering school subscriptions
In order to manage a school's textbook subscriptions
As a super user
I want to be add and remove textbooks from a school's subscriptions
Scenario: index
Given I am logged in as a super-user
And a school quot;Gymea Techquot; exists
When I go to the school admin book subscriptions for quot;Gymea Techquot;
Then I see the page
15. Feature: Administering school subscriptions
In order to manage a school's textbook subscriptions
As a super user
I want to be add and remove textbooks from a school's subscriptions
Scenario: index
Given I am logged in as a super-user
And a school quot;Gymea Techquot; exists
When I go to the school admin book subscriptions for quot;Gymea Techquot;
Then I see the page
16. def path_to(page_name) when /^new school admin$/
case page_name new_admin_school_path
when /^the homepage$/ when /^the school admin for quot;(.*)quot;$/
root_path admin_school_path(school_with_name($1))
when /^the books page$/ when /^the school admin book subscriptions for quot;(.*)quot;$/
books_path admin_school_book_subscriptions_path(school_with_name($1))
when /^the login page$/ when /^the admin school admins path for quot;(.*)quot;$/
login_path admin_school_admins_path(school_with_name($1))
when /^logout$/ when /^the book homepage for quot;(.*)quot;$$/
logout_path book_path(book_with_title($1))
when /^the forgot password page$/ when /^the first article in quot;(.*)quot;$/
new_forgot_password_path book = book_with_title($1)
book_article_path(book, book.articles.first)
when /^the register page$/
register_path when /^the text version of the first article in quot;(.*)quot;$/
book = book_with_title($1)
when /^the admin$/ book_article_path(book, book.articles.first, quot;textquot;)
admin_path
when /^the image path quot;(.*)quot; for quot;(.*)quot;$/
when /^the super-users admin$/ book_image_path(book_with_title($2), $1.split(quot;/quot;))
admin_super_users_path
else
when /^the schools admin$/ raise quot;Mapping from quot;#{page_name}quot; to a path not definedquot;
admin_schools_path end
end
17. Feature: Feedback form
Scenario: submitting feedback w/ an email address
Given logged in
When post /feedback with {:email => quot;bob@bob.comquot;}
Then response 302 to /feedback/thanks?reply=true
And contact@agencyrainford.com receives an email
18. When /^post ([^s]+) with ({.*})$/ do |path, params|
post path, eval(params)
end