aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-10 13:27:17 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-08-09 18:32:03 +0100
commitc7efa9f49a3aa1744fd12d00ba409734ec217b1a (patch)
tree561cc02bb4cf7f87eaa2c4943b11ea132aaaea15 /t/app/controller
parent4cdf8b0c15052fd06d811137dda52e3bac65028e (diff)
add a ban email address button
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/admin.t42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 4e2ec82fe..0acaffc8d 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -488,6 +488,27 @@ subtest 'change email to new user' => sub {
is $report->user_id, $user3->id, 'user changed to new user';
};
+subtest 'adding email to abuse list from report page' => sub {
+ my $email = $report->user->email;
+
+ my $abuse = FixMyStreet::App->model('DB::Abuse')->find( { email => $email } );
+ $abuse->delete if $abuse;
+
+ $mech->get_ok( '/admin/report_edit/' . $report->id );
+ $mech->content_contains('Ban email address');
+
+ $mech->click_ok('banuser');
+
+ $mech->content_contains('Email added to abuse list');
+ $mech->content_contains('<small>(Email in abuse table)</small>');
+
+ $abuse = FixMyStreet::App->model('DB::Abuse')->find( { email => $email } );
+ ok $abuse, 'entry created in abuse table';
+
+ $mech->get_ok( '/admin/report_edit/' . $report->id );
+ $mech->content_contains('<small>(Email in abuse table)</small>');
+};
+
$log_entries->delete;
my $update = FixMyStreet::App->model('DB::Comment')->create(
@@ -668,6 +689,27 @@ subtest 'editing update email creates new user if required' => sub {
is $update->user->id, $user->id, 'update set to new user';
};
+subtest 'adding email to abuse list from update page' => sub {
+ my $email = $update->user->email;
+
+ my $abuse = FixMyStreet::App->model('DB::Abuse')->find( { email => $email } );
+ $abuse->delete if $abuse;
+
+ $mech->get_ok( '/admin/update_edit/' . $update->id );
+ $mech->content_contains('Ban email address');
+
+ $mech->click_ok('banuser');
+
+ $mech->content_contains('Email added to abuse list');
+ $mech->content_contains('<small>(Email in abuse table)</small>');
+
+ $abuse = FixMyStreet::App->model('DB::Abuse')->find( { email => $email } );
+ ok $abuse, 'entry created in abuse table';
+
+ $mech->get_ok( '/admin/update_edit/' . $update->id );
+ $mech->content_contains('<small>(Email in abuse table)</small>');
+};
+
subtest 'hiding comment marked as fixed reopens report' => sub {
$update->mark_fixed( 1 );
$update->update;
ion> Unnamed repository; edit this file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/doc/THEMES.md
blob: 8a4828a992bdec2c030ee0b35d2335bc67e78869 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165