Closed jmax closed 11 years ago
Scenario: Failed posting
I am logged in with bruce@wayne.com user account and I visit "/alert-the-team"
when I click on "Notify the team"
then Notification.count should equal zero and the page should have "Reason can't be blank" and the page should have "On can't be blank" and current path should equal "/notifications"
Scenario: Unauthorized access
I am on the homepage
when I visit "/alert-the-team"
then current_path should equal login path
I am logged in with bruce@wayne.com user account and I visit "/alert-the-team"
when I fill in "Reason" with "Doctor Appointment" and I fill in "On" with 3.days.from_now and I click on "Notify the team"
then Notification.where(reason: "Doctor Appointment") should exist and Notification.last.author should equal current logged in user and current_user.company.notifications should include Notification.last