send_email_to_environment_members.feature 1.44 KB
Feature: send emails to environment members users
  As an administrator
  I want to send email to all users

  Scenario: Cant access if not logged in
    Given I am not logged in
    When I go to /admin/users/send_mail
    Then I should be on login page

  Scenario: Cant access as normal user
    Given the following user
      | login |
      | ultraje |
    And I am logged in as "ultraje"
    When I go to /admin/users/send_mail
    Then I should see "Access denied"

  Scenario: Send e-mail to members
    Given I am logged in as admin
    And I go to /admin/users/send_mail
    And I fill in "Subject" with "Hello, user!"
    And I fill in "Body" with "We have some news"
    When I press "Send"
    Then I should be on /admin/users

  Scenario: Not send e-mail to members if subject is blank
    Given I am logged in as admin
    And I go to /admin/users/send_mail
    And I fill in "Body" with "We have some news"
    When I press "Send"
    Then I should be on /admin/users/send_mail

  Scenario: Not send e-mail to members if body is blank
    Given I am logged in as admin
    And I go to /admin/users/send_mail
    And I fill in "Subject" with "Hello, user!"
    When I press "Send"
    Then I should be on /admin/users/send_mail

  Scenario: Cancel creation of mailing
    Given I am logged in as admin
    And I go to /admin/users/send_mail
    Then I should be on /admin/users/send_mail
    When I follow "Cancel e-mail"
    Then I should be on /admin/users