send_email_to_environment_members.feature
2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
Scenario: Should display recipients options
Given I am logged in as admin
And I go to /admin/users/send_mail
Then I should see "Recipients"
Then I should see "All Users"
Then I should see "Only Admins"
Then I should see "Environment Admins"
Then I should see "Profile Admins"
Scenario: All users should be marked as default recipients
Given I am logged in as admin
And I go to /admin/users/send_mail
Then the "send_to_all" radio button should be checked
Then the "send_to_admins" radio button should not be checked
@selenium
Scenario: Should disable checkboxes when recipients is set to All users
Given I am logged in as admin
And I go to /admin/users/send_mail
Then the field "#profile_admins" should be disabled
Then the field "#env_admins" should be disabled
When I choose "Only Admins"
Then the field "#profile_admins" should be enabled
Then the field "#env_admins" should be enabled