text_sanitizer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +90 -0
  3. data/Rakefile +38 -0
  4. data/lib/tasks/text_sanitizer_tasks.rake +4 -0
  5. data/lib/text_sanitizer/text_sanitizer.rb +75 -0
  6. data/lib/text_sanitizer/version.rb +3 -0
  7. data/lib/text_sanitizer.rb +4 -0
  8. data/test/dummy/README.rdoc +261 -0
  9. data/test/dummy/Rakefile +7 -0
  10. data/test/dummy/app/assets/javascripts/application.js +15 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  12. data/test/dummy/app/controllers/application_controller.rb +3 -0
  13. data/test/dummy/app/helpers/application_helper.rb +2 -0
  14. data/test/dummy/app/models/post.rb +6 -0
  15. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  16. data/test/dummy/config/application.rb +59 -0
  17. data/test/dummy/config/boot.rb +10 -0
  18. data/test/dummy/config/database.yml +25 -0
  19. data/test/dummy/config/environment.rb +5 -0
  20. data/test/dummy/config/environments/development.rb +37 -0
  21. data/test/dummy/config/environments/production.rb +67 -0
  22. data/test/dummy/config/environments/test.rb +37 -0
  23. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  24. data/test/dummy/config/initializers/inflections.rb +15 -0
  25. data/test/dummy/config/initializers/mime_types.rb +5 -0
  26. data/test/dummy/config/initializers/secret_token.rb +7 -0
  27. data/test/dummy/config/initializers/session_store.rb +8 -0
  28. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  29. data/test/dummy/config/locales/en.yml +5 -0
  30. data/test/dummy/config/routes.rb +58 -0
  31. data/test/dummy/config.ru +4 -0
  32. data/test/dummy/db/development.sqlite3 +0 -0
  33. data/test/dummy/db/migrate/20120622103727_create_posts.rb +11 -0
  34. data/test/dummy/db/migrate/20120622105359_add_name_to_posts.rb +5 -0
  35. data/test/dummy/db/schema.rb +25 -0
  36. data/test/dummy/db/test.sqlite3 +0 -0
  37. data/test/dummy/log/development.log +47 -0
  38. data/test/dummy/log/test.log +385 -0
  39. data/test/dummy/public/404.html +26 -0
  40. data/test/dummy/public/422.html +26 -0
  41. data/test/dummy/public/500.html +25 -0
  42. data/test/dummy/public/favicon.ico +0 -0
  43. data/test/dummy/script/rails +6 -0
  44. data/test/dummy/test/fixtures/posts.yml +11 -0
  45. data/test/dummy/test/unit/post_test.rb +7 -0
  46. data/test/test_helper.rb +15 -0
  47. data/test/text_sanitizer_test.rb +37 -0
  48. metadata +182 -0
@@ -0,0 +1,385 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+  (1.0ms) begin transaction
4
+  (0.1ms) rollback transaction
5
+  (0.1ms) begin transaction
6
+  (0.1ms) rollback transaction
7
+ Connecting to database specified by database.yml
8
+  (1.0ms) begin transaction
9
+  (0.1ms) rollback transaction
10
+  (0.1ms) begin transaction
11
+  (0.1ms) rollback transaction
12
+ Connecting to database specified by database.yml
13
+ Connecting to database specified by database.yml
14
+  (0.2ms) begin transaction
15
+  (0.1ms) SAVEPOINT active_record_1
16
+ SQL (25.4ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:42:26 UTC +00:00], ["email", "upcase@email.com"], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:42:26 UTC +00:00]]
17
+  (0.2ms) RELEASE SAVEPOINT active_record_1
18
+  (2.3ms) rollback transaction
19
+  (0.3ms) begin transaction
20
+  (0.1ms) rollback transaction
21
+ Connecting to database specified by database.yml
22
+  (0.2ms) begin transaction
23
+  (0.1ms) SAVEPOINT active_record_1
24
+ SQL (19.4ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:43:11 UTC +00:00], ["email", "upcase@email.com"], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:43:11 UTC +00:00]]
25
+  (0.2ms) RELEASE SAVEPOINT active_record_1
26
+  (0.8ms) rollback transaction
27
+  (0.1ms) begin transaction
28
+  (0.1ms) rollback transaction
29
+ Connecting to database specified by database.yml
30
+  (0.2ms) begin transaction
31
+  (0.2ms) SAVEPOINT active_record_1
32
+ SQL (18.2ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:43:29 UTC +00:00], ["email", "upcase@email.com"], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:43:29 UTC +00:00]]
33
+  (0.2ms) RELEASE SAVEPOINT active_record_1
34
+  (0.7ms) rollback transaction
35
+  (0.1ms) begin transaction
36
+  (0.1ms) rollback transaction
37
+ Connecting to database specified by database.yml
38
+  (0.2ms) begin transaction
39
+  (0.1ms) SAVEPOINT active_record_1
40
+ SQL (19.6ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00], ["email", nil], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00]]
41
+  (0.2ms) RELEASE SAVEPOINT active_record_1
42
+  (1.0ms) rollback transaction
43
+  (0.2ms) begin transaction
44
+  (0.1ms) SAVEPOINT active_record_1
45
+ SQL (3.9ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00], ["email", "upcase@email.com"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00]]
46
+  (0.2ms) RELEASE SAVEPOINT active_record_1
47
+  (0.7ms) rollback transaction
48
+  (0.1ms) begin transaction
49
+  (0.1ms) rollback transaction
50
+  (0.1ms) begin transaction
51
+  (0.1ms) SAVEPOINT active_record_1
52
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00], ["email", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:45:40 UTC +00:00]]
53
+  (0.1ms) RELEASE SAVEPOINT active_record_1
54
+  (0.7ms) rollback transaction
55
+  (0.1ms) begin transaction
56
+  (0.1ms) rollback transaction
57
+ Connecting to database specified by database.yml
58
+  (0.2ms) begin transaction
59
+  (0.1ms) SAVEPOINT active_record_1
60
+ SQL (21.0ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:49:20 UTC +00:00], ["email", nil], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:49:20 UTC +00:00]]
61
+  (0.2ms) RELEASE SAVEPOINT active_record_1
62
+  (0.8ms) rollback transaction
63
+  (0.1ms) begin transaction
64
+  (0.1ms) SAVEPOINT active_record_1
65
+ SQL (4.6ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:49:20 UTC +00:00], ["email", "upcase@email.com"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:49:20 UTC +00:00]]
66
+  (0.1ms) RELEASE SAVEPOINT active_record_1
67
+  (0.7ms) rollback transaction
68
+  (0.1ms) begin transaction
69
+  (0.1ms) SAVEPOINT active_record_1
70
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
71
+  (0.1ms) rollback transaction
72
+  (0.1ms) begin transaction
73
+  (0.1ms) SAVEPOINT active_record_1
74
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
75
+  (0.1ms) rollback transaction
76
+  (0.1ms) begin transaction
77
+  (0.1ms) rollback transaction
78
+ Connecting to database specified by database.yml
79
+  (0.2ms) begin transaction
80
+  (0.1ms) SAVEPOINT active_record_1
81
+ SQL (18.9ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00], ["email", nil], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00]]
82
+  (0.2ms) RELEASE SAVEPOINT active_record_1
83
+  (0.7ms) rollback transaction
84
+  (0.1ms) begin transaction
85
+  (0.1ms) SAVEPOINT active_record_1
86
+ SQL (3.4ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00], ["email", "upcase@email.com"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00]]
87
+  (0.1ms) RELEASE SAVEPOINT active_record_1
88
+  (0.7ms) rollback transaction
89
+  (0.1ms) begin transaction
90
+  (0.2ms) SAVEPOINT active_record_1
91
+ SQL (4.0ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00], ["email", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 10:50:41 UTC +00:00]]
92
+  (0.1ms) RELEASE SAVEPOINT active_record_1
93
+  (0.7ms) rollback transaction
94
+  (0.1ms) begin transaction
95
+  (0.1ms) SAVEPOINT active_record_1
96
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
97
+  (0.1ms) rollback transaction
98
+  (0.2ms) begin transaction
99
+  (0.1ms) rollback transaction
100
+ Connecting to database specified by database.yml
101
+  (0.2ms) begin transaction
102
+  (0.1ms) SAVEPOINT active_record_1
103
+ SQL (18.7ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00], ["email", nil], ["title", "Lower Case"], ["updated_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00]]
104
+  (0.2ms) RELEASE SAVEPOINT active_record_1
105
+  (0.8ms) rollback transaction
106
+  (0.1ms) begin transaction
107
+  (0.1ms) SAVEPOINT active_record_1
108
+ SQL (2.4ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00], ["email", "upcase@email.com"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00]]
109
+  (0.2ms) RELEASE SAVEPOINT active_record_1
110
+  (0.8ms) rollback transaction
111
+  (0.1ms) begin transaction
112
+  (0.1ms) SAVEPOINT active_record_1
113
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00], ["email", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 10:51:28 UTC +00:00]]
114
+  (0.2ms) RELEASE SAVEPOINT active_record_1
115
+  (1.1ms) rollback transaction
116
+  (0.1ms) begin transaction
117
+  (0.1ms) SAVEPOINT active_record_1
118
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
119
+  (0.1ms) rollback transaction
120
+  (0.1ms) begin transaction
121
+  (0.1ms) rollback transaction
122
+ Connecting to database specified by database.yml
123
+  (0.2ms) begin transaction
124
+  (0.1ms) rollback transaction
125
+  (0.1ms) begin transaction
126
+  (0.2ms) SAVEPOINT active_record_1
127
+ SQL (19.1ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:54:55 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:54:55 UTC +00:00]]
128
+  (0.2ms) RELEASE SAVEPOINT active_record_1
129
+  (0.7ms) rollback transaction
130
+  (0.1ms) begin transaction
131
+  (0.2ms) SAVEPOINT active_record_1
132
+ SQL (3.6ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:54:55 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 10:54:55 UTC +00:00]]
133
+  (0.1ms) RELEASE SAVEPOINT active_record_1
134
+  (0.7ms) rollback transaction
135
+  (0.1ms) begin transaction
136
+  (0.1ms) SAVEPOINT active_record_1
137
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
138
+  (0.1ms) rollback transaction
139
+  (0.1ms) begin transaction
140
+  (0.1ms) rollback transaction
141
+ Connecting to database specified by database.yml
142
+  (0.2ms) begin transaction
143
+  (0.1ms) SAVEPOINT active_record_1
144
+ SQL (18.4ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:55:30 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:55:30 UTC +00:00]]
145
+  (0.2ms) RELEASE SAVEPOINT active_record_1
146
+  (0.8ms) rollback transaction
147
+  (0.1ms) begin transaction
148
+  (0.1ms) SAVEPOINT active_record_1
149
+ SQL (2.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:55:31 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:55:31 UTC +00:00]]
150
+  (0.1ms) RELEASE SAVEPOINT active_record_1
151
+  (0.7ms) rollback transaction
152
+  (0.1ms) begin transaction
153
+  (0.1ms) SAVEPOINT active_record_1
154
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:55:31 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 10:55:31 UTC +00:00]]
155
+  (0.2ms) RELEASE SAVEPOINT active_record_1
156
+  (0.8ms) rollback transaction
157
+  (0.1ms) begin transaction
158
+  (0.1ms) SAVEPOINT active_record_1
159
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
160
+  (0.1ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+  (0.1ms) rollback transaction
163
+ Connecting to database specified by database.yml
164
+  (0.2ms) begin transaction
165
+  (0.1ms) SAVEPOINT active_record_1
166
+ SQL (19.1ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00]]
167
+  (0.2ms) RELEASE SAVEPOINT active_record_1
168
+  (0.7ms) rollback transaction
169
+  (0.1ms) begin transaction
170
+  (0.1ms) SAVEPOINT active_record_1
171
+ SQL (3.6ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00]]
172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
173
+  (0.7ms) rollback transaction
174
+  (0.1ms) begin transaction
175
+  (0.1ms) SAVEPOINT active_record_1
176
+ SQL (2.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:56:08 UTC +00:00]]
177
+  (0.1ms) RELEASE SAVEPOINT active_record_1
178
+  (0.7ms) rollback transaction
179
+  (0.1ms) begin transaction
180
+  (0.1ms) rollback transaction
181
+ Connecting to database specified by database.yml
182
+  (0.2ms) begin transaction
183
+  (0.2ms) SAVEPOINT active_record_1
184
+ SQL (18.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00]]
185
+  (0.2ms) RELEASE SAVEPOINT active_record_1
186
+  (0.7ms) rollback transaction
187
+  (0.1ms) begin transaction
188
+  (0.1ms) SAVEPOINT active_record_1
189
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00]]
190
+  (0.2ms) RELEASE SAVEPOINT active_record_1
191
+  (0.9ms) rollback transaction
192
+  (0.1ms) begin transaction
193
+  (0.1ms) SAVEPOINT active_record_1
194
+ SQL (2.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 10:59:15 UTC +00:00]]
195
+  (0.1ms) RELEASE SAVEPOINT active_record_1
196
+  (0.7ms) rollback transaction
197
+  (0.1ms) begin transaction
198
+  (0.1ms) rollback transaction
199
+ Connecting to database specified by database.yml
200
+  (0.2ms) begin transaction
201
+  (0.2ms) SAVEPOINT active_record_1
202
+ SQL (19.7ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00]]
203
+  (0.2ms) RELEASE SAVEPOINT active_record_1
204
+  (0.8ms) rollback transaction
205
+  (0.2ms) begin transaction
206
+  (0.1ms) SAVEPOINT active_record_1
207
+ SQL (3.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00]]
208
+  (0.1ms) RELEASE SAVEPOINT active_record_1
209
+  (0.7ms) rollback transaction
210
+  (0.1ms) begin transaction
211
+  (0.1ms) SAVEPOINT active_record_1
212
+ SQL (3.9ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:05:17 UTC +00:00]]
213
+  (0.2ms) RELEASE SAVEPOINT active_record_1
214
+  (0.7ms) rollback transaction
215
+  (0.1ms) begin transaction
216
+  (0.1ms) SAVEPOINT active_record_1
217
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
218
+  (0.1ms) rollback transaction
219
+  (0.1ms) begin transaction
220
+  (0.1ms) rollback transaction
221
+ Connecting to database specified by database.yml
222
+  (0.2ms) begin transaction
223
+  (0.2ms) SAVEPOINT active_record_1
224
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
225
+  (0.1ms) rollback transaction
226
+  (0.1ms) begin transaction
227
+  (0.1ms) SAVEPOINT active_record_1
228
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
229
+  (0.1ms) rollback transaction
230
+  (0.1ms) begin transaction
231
+  (0.1ms) SAVEPOINT active_record_1
232
+ SQL (63.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:09:33 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:09:33 UTC +00:00]]
233
+  (0.1ms) RELEASE SAVEPOINT active_record_1
234
+  (0.7ms) rollback transaction
235
+  (0.1ms) begin transaction
236
+  (0.1ms) SAVEPOINT active_record_1
237
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
238
+  (0.1ms) rollback transaction
239
+  (0.1ms) begin transaction
240
+  (0.1ms) rollback transaction
241
+ Connecting to database specified by database.yml
242
+  (0.2ms) begin transaction
243
+  (0.1ms) SAVEPOINT active_record_1
244
+  (0.2ms) ROLLBACK TO SAVEPOINT active_record_1
245
+  (0.1ms) rollback transaction
246
+  (0.1ms) begin transaction
247
+  (0.1ms) SAVEPOINT active_record_1
248
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
249
+  (0.1ms) rollback transaction
250
+  (0.1ms) begin transaction
251
+  (0.1ms) SAVEPOINT active_record_1
252
+ SQL (63.8ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:11:11 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:11:11 UTC +00:00]]
253
+  (0.1ms) RELEASE SAVEPOINT active_record_1
254
+  (0.7ms) rollback transaction
255
+  (0.1ms) begin transaction
256
+  (0.1ms) SAVEPOINT active_record_1
257
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
258
+  (0.1ms) rollback transaction
259
+  (0.1ms) begin transaction
260
+  (0.1ms) rollback transaction
261
+ Connecting to database specified by database.yml
262
+  (0.2ms) begin transaction
263
+  (0.2ms) SAVEPOINT active_record_1
264
+ SQL (63.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:12:38 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:12:38 UTC +00:00]]
265
+  (0.2ms) RELEASE SAVEPOINT active_record_1
266
+  (1.0ms) rollback transaction
267
+  (0.1ms) begin transaction
268
+  (0.1ms) rollback transaction
269
+ Connecting to database specified by database.yml
270
+  (0.2ms) begin transaction
271
+  (0.2ms) SAVEPOINT active_record_1
272
+ SQL (67.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:18:49 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:18:49 UTC +00:00]]
273
+  (0.2ms) RELEASE SAVEPOINT active_record_1
274
+  (0.7ms) rollback transaction
275
+  (0.2ms) begin transaction
276
+  (0.1ms) rollback transaction
277
+ Connecting to database specified by database.yml
278
+  (0.2ms) begin transaction
279
+  (0.1ms) SAVEPOINT active_record_1
280
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
281
+  (0.1ms) rollback transaction
282
+  (0.1ms) begin transaction
283
+  (0.1ms) rollback transaction
284
+ Connecting to database specified by database.yml
285
+  (0.2ms) begin transaction
286
+  (0.1ms) SAVEPOINT active_record_1
287
+ SQL (73.7ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:20:22 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", ""], ["updated_at", Fri, 22 Jun 2012 11:20:22 UTC +00:00]]
288
+  (0.2ms) RELEASE SAVEPOINT active_record_1
289
+  (0.7ms) rollback transaction
290
+  (0.2ms) begin transaction
291
+  (0.2ms) rollback transaction
292
+ Connecting to database specified by database.yml
293
+  (0.2ms) begin transaction
294
+  (0.2ms) SAVEPOINT active_record_1
295
+ SQL (63.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00]]
296
+  (0.1ms) RELEASE SAVEPOINT active_record_1
297
+  (0.7ms) rollback transaction
298
+  (0.1ms) begin transaction
299
+  (0.1ms) SAVEPOINT active_record_1
300
+ SQL (2.7ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00]]
301
+  (0.1ms) RELEASE SAVEPOINT active_record_1
302
+  (0.7ms) rollback transaction
303
+  (0.1ms) begin transaction
304
+  (0.1ms) rollback transaction
305
+  (0.1ms) begin transaction
306
+  (0.1ms) SAVEPOINT active_record_1
307
+ SQL (2.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:21:59 UTC +00:00]]
308
+  (0.1ms) RELEASE SAVEPOINT active_record_1
309
+  (0.6ms) rollback transaction
310
+  (0.1ms) begin transaction
311
+  (0.1ms) rollback transaction
312
+ Connecting to database specified by database.yml
313
+  (0.2ms) begin transaction
314
+  (0.2ms) SAVEPOINT active_record_1
315
+ SQL (65.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00]]
316
+  (0.1ms) RELEASE SAVEPOINT active_record_1
317
+  (0.7ms) rollback transaction
318
+  (0.1ms) begin transaction
319
+  (0.1ms) SAVEPOINT active_record_1
320
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00]]
321
+  (0.1ms) RELEASE SAVEPOINT active_record_1
322
+  (0.7ms) rollback transaction
323
+  (0.1ms) begin transaction
324
+  (0.2ms) SAVEPOINT active_record_1
325
+ SQL (2.4ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00]]
326
+  (0.1ms) RELEASE SAVEPOINT active_record_1
327
+  (0.7ms) rollback transaction
328
+  (0.1ms) begin transaction
329
+  (0.1ms) SAVEPOINT active_record_1
330
+ SQL (2.8ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:22:59 UTC +00:00]]
331
+  (0.2ms) RELEASE SAVEPOINT active_record_1
332
+  (0.8ms) rollback transaction
333
+  (0.1ms) begin transaction
334
+  (0.1ms) rollback transaction
335
+ Connecting to database specified by database.yml
336
+  (0.2ms) begin transaction
337
+  (0.2ms) SAVEPOINT active_record_1
338
+ SQL (63.1ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00]]
339
+  (0.2ms) RELEASE SAVEPOINT active_record_1
340
+  (0.7ms) rollback transaction
341
+  (0.1ms) begin transaction
342
+  (0.1ms) SAVEPOINT active_record_1
343
+ SQL (2.5ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00]]
344
+  (0.1ms) RELEASE SAVEPOINT active_record_1
345
+  (1.0ms) rollback transaction
346
+  (0.1ms) begin transaction
347
+  (0.1ms) SAVEPOINT active_record_1
348
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00]]
349
+  (0.1ms) RELEASE SAVEPOINT active_record_1
350
+  (0.8ms) rollback transaction
351
+  (0.1ms) begin transaction
352
+  (0.1ms) SAVEPOINT active_record_1
353
+ SQL (2.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:24:22 UTC +00:00]]
354
+  (0.1ms) RELEASE SAVEPOINT active_record_1
355
+  (0.7ms) rollback transaction
356
+  (0.1ms) begin transaction
357
+  (0.1ms) rollback transaction
358
+ Connecting to database specified by database.yml
359
+  (0.2ms) begin transaction
360
+  (0.2ms) SAVEPOINT active_record_1
361
+ SQL (66.6ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00], ["email", nil], ["name", "Lower Case"], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00]]
362
+  (0.1ms) RELEASE SAVEPOINT active_record_1
363
+  (0.7ms) rollback transaction
364
+  (0.1ms) begin transaction
365
+  (0.1ms) SAVEPOINT active_record_1
366
+ SQL (2.9ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00], ["email", "upcase@email.com"], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00]]
367
+  (0.1ms) RELEASE SAVEPOINT active_record_1
368
+  (0.6ms) rollback transaction
369
+  (0.1ms) begin transaction
370
+  (0.2ms) SAVEPOINT active_record_1
371
+ SQL (2.3ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00], ["email", nil], ["name", nil], ["title", "LOWER CASE"], ["updated_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00]]
372
+  (0.1ms) RELEASE SAVEPOINT active_record_1
373
+  (0.8ms) rollback transaction
374
+  (0.1ms) begin transaction
375
+  (0.1ms) SAVEPOINT active_record_1
376
+ SQL (4.4ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", "with script"], ["created_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00]]
377
+  (0.1ms) RELEASE SAVEPOINT active_record_1
378
+  (0.7ms) rollback transaction
379
+  (0.1ms) begin transaction
380
+  (0.1ms) SAVEPOINT active_record_1
381
+ SQL (3.2ms) INSERT INTO "posts" ("body", "created_at", "email", "name", "title", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["body", nil], ["created_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00], ["email", nil], ["name", nil], ["title", nil], ["updated_at", Fri, 22 Jun 2012 11:25:08 UTC +00:00]]
382
+  (0.1ms) RELEASE SAVEPOINT active_record_1
383
+  (0.7ms) rollback transaction
384
+  (0.1ms) begin transaction
385
+  (0.1ms) rollback transaction
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ body: MyText
6
+ email: MyString
7
+
8
+ two:
9
+ title: MyString
10
+ body: MyText
11
+ email: MyString
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
@@ -0,0 +1,37 @@
1
+ require 'rubygems'
2
+ require 'test_helper'
3
+ require 'text_sanitizer'
4
+
5
+ class TextSanitizerTest < ActiveSupport::TestCase
6
+ test "truth" do
7
+ assert_kind_of Module, TextSanitizer
8
+ end
9
+
10
+ test "capitalize_text should capitalize text" do
11
+ post = Post.create(name: 'lower case')
12
+ assert_equal 'Lower Case', post.name
13
+ end
14
+
15
+ test "sanitize_text should sanitize text" do
16
+ post = Post.create(body: '<script>with script</script>')
17
+ assert_equal 'with script', post.body
18
+ end
19
+
20
+ test "downcase_text should downcase text" do
21
+ post = Post.create(email: 'UPCASE@EMAIL.COM')
22
+ assert_equal 'upcase@email.com', post.email
23
+ end
24
+
25
+ test "method register_sanitizer should be defined" do
26
+ Post.send :define_method, :upcase do |text|
27
+ text.upcase
28
+ end
29
+ Post.register_sanitizer :upcase, :before_validation, :title
30
+ post = Post.create(title:'lower case')
31
+ assert_equal 'LOWER CASE', post.title
32
+ end
33
+
34
+ test "shouldn't break if text fields are not defined" do
35
+ Post.create
36
+ end
37
+ end