insignia4u / meoff

Simple team communication tool aimed to keep everybody on the loop on who's gonna be out.
MIT License
0 stars 0 forks source link

[Notifications] Posting a new notification #4

Closed jmax closed 11 years ago

jmax commented 11 years ago

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

jmax commented 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"

jmax commented 11 years ago

Scenario: Unauthorized access

I am on the homepage

when I visit "/alert-the-team"

then current_path should equal login path