parlement 0.3 → 0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. data/CHANGES +16 -0
  2. data/README +36 -3
  3. data/Rakefile +8 -12
  4. data/app/controllers/account_controller.rb +2 -0
  5. data/app/controllers/elt_controller.rb +1 -5
  6. data/app/controllers/subscriber_controller.rb +1 -1
  7. data/app/helpers/elt_helper.rb +30 -10
  8. data/app/models/elt.rb +2 -1
  9. data/app/models/mail.rb +41 -41
  10. data/app/models/mail_notify.rb +27 -10
  11. data/app/views/account/_login.rhtml +9 -7
  12. data/app/views/account/_show.rhtml +4 -4
  13. data/app/views/elt/_elt.rhtml +52 -51
  14. data/app/views/elt/_list.rhtml +22 -14
  15. data/app/views/elt/new.rhtml +1 -1
  16. data/app/views/elt/show.rhtml +15 -16
  17. data/app/views/layouts/top.rhtml +13 -1
  18. data/app/views/person/show.rhtml +1 -7
  19. data/config/boot.rb +32 -7
  20. data/config/database.yml +3 -0
  21. data/config/environment.rb +3 -1
  22. data/config/environments/development.rb +1 -1
  23. data/db/ROOT/parlement/ddRing.txt +14 -0
  24. data/db/ROOT/parlement/top-politics.txt +12 -0
  25. data/db/ROOT/perso.txt +1 -1
  26. data/db/development_structure.sql +30 -16
  27. data/db/schema.rb +18 -10
  28. data/db/schema.sql +34 -34
  29. data/public/javascripts/application.js +2 -0
  30. data/public/javascripts/blank.gif +0 -0
  31. data/public/javascripts/borders.js +687 -0
  32. data/public/javascripts/controls.js +95 -30
  33. data/public/javascripts/dragdrop.js +161 -21
  34. data/public/javascripts/effects.js +310 -211
  35. data/public/javascripts/ie7-load.htc +1 -0
  36. data/public/javascripts/prototype.js +228 -28
  37. data/test/fixtures/attachments.yml +3 -0
  38. data/test/fixtures/mail/mail_ruby +1 -0
  39. data/test/fixtures/people.yml +14 -0
  40. data/test/functional/account_controller_test.rb +3 -2
  41. data/test/unit/mail_notify_test.rb +2 -0
  42. data/test/unit/mail_test.rb +59 -6
  43. data/test/unit/person_test.rb +1 -1
  44. data/vendor/plugins/engines/CHANGELOG +92 -0
  45. data/vendor/plugins/engines/MIT-LICENSE +21 -0
  46. data/vendor/plugins/engines/README +325 -39
  47. data/vendor/plugins/engines/generators/engine/USAGE +26 -0
  48. data/vendor/plugins/engines/generators/engine/engine_generator.rb +199 -0
  49. data/vendor/plugins/engines/generators/engine/templates/README +85 -0
  50. data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +13 -0
  51. data/vendor/plugins/engines/generators/engine/templates/install.erb +4 -0
  52. data/vendor/plugins/engines/generators/engine/templates/lib/engine.erb +6 -0
  53. data/vendor/plugins/engines/generators/engine/templates/licenses/GPL +18 -0
  54. data/vendor/plugins/engines/generators/engine/templates/licenses/LGPL +19 -0
  55. data/vendor/plugins/engines/generators/engine/templates/licenses/MIT +22 -0
  56. data/vendor/plugins/engines/generators/engine/templates/licenses/None +1 -0
  57. data/vendor/plugins/engines/generators/engine/templates/public/javascripts/engine.js +0 -0
  58. data/vendor/plugins/engines/generators/engine/templates/public/stylesheets/engine.css +0 -0
  59. data/vendor/plugins/engines/generators/engine/templates/tasks/engine.rake +0 -0
  60. data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +13 -0
  61. data/vendor/plugins/engines/init.rb +18 -3
  62. data/vendor/plugins/engines/lib/bundles/require_resource.rb +124 -0
  63. data/vendor/plugins/engines/lib/bundles.rb +77 -0
  64. data/vendor/plugins/engines/lib/{action_mailer_extensions.rb → engines/action_mailer_extensions.rb} +15 -36
  65. data/vendor/plugins/engines/lib/{action_view_extensions.rb → engines/action_view_extensions.rb} +40 -33
  66. data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +19 -0
  67. data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +118 -0
  68. data/vendor/plugins/engines/lib/engines/migration_extensions.rb +53 -0
  69. data/vendor/plugins/engines/lib/{ruby_extensions.rb → engines/ruby_extensions.rb} +14 -28
  70. data/vendor/plugins/engines/lib/engines/testing_extensions.rb +323 -0
  71. data/vendor/plugins/engines/lib/engines.rb +258 -148
  72. data/vendor/plugins/engines/tasks/engines.rake +161 -0
  73. data/vendor/plugins/engines/test/action_view_extensions_test.rb +9 -0
  74. data/vendor/plugins/engines/test/ruby_extensions_test.rb +24 -3
  75. data/vendor/plugins/guid/README.TXT +14 -4
  76. data/vendor/plugins/guid/init.rb +9 -2
  77. data/vendor/plugins/guid/lib/uuidtools.rb +22 -15
  78. data/vendor/plugins/login_engine/CHANGELOG +14 -0
  79. data/vendor/plugins/login_engine/README +93 -7
  80. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +30 -20
  81. data/vendor/plugins/login_engine/app/helpers/user_helper.rb +1 -1
  82. data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +2 -2
  83. data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +25 -0
  84. data/vendor/plugins/login_engine/install.rb +4 -0
  85. data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +11 -5
  86. data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +15 -9
  87. data/vendor/plugins/login_engine/lib/login_engine.rb +7 -3
  88. data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +22 -19
  89. data/vendor/plugins/login_engine/test/test_helper.rb +4 -8
  90. data/vendor/plugins/login_engine/test/unit/user_test.rb +31 -11
  91. metadata +60 -57
  92. data/app/models/attachment.rb +0 -6
  93. data/public/attachment/file/architecture.png +0 -0
  94. data/public/attachment/file/architecture.svg +0 -8972
  95. data/public/attachment/file/security.svg +0 -8960
  96. data/public/engine_files/login_engine/stylesheets/login_engine.css +0 -81
  97. data/public/oldREADME +0 -190
  98. data/public/stylesheets/default.css +0 -235
  99. data/public/stylesheets/live_tree.css +0 -62
  100. data/public/stylesheets/scaffold.css +0 -74
  101. data/script/about +0 -3
  102. data/script/benchmarker +0 -19
  103. data/script/breakpointer +0 -3
  104. data/script/console +0 -3
  105. data/script/create_db +0 -7
  106. data/script/destroy +0 -3
  107. data/script/generate +0 -3
  108. data/script/performance/benchmarker +0 -3
  109. data/script/performance/profiler +0 -3
  110. data/script/plugin +0 -3
  111. data/script/process/reaper +0 -3
  112. data/script/process/spawner +0 -3
  113. data/script/process/spinner +0 -3
  114. data/script/profiler +0 -34
  115. data/script/runner +0 -3
  116. data/script/server +0 -3
  117. data/test/unit/user_test.rb +0 -94
  118. data/vendor/plugins/engines/lib/dependencies_extensions.rb +0 -56
  119. data/vendor/plugins/engines/lib/testing_extensions.rb +0 -33
  120. data/vendor/plugins/login_engine/db/schema.rb +0 -25
  121. data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +0 -41
  122. /data/public/images/{eltBackground.png → eltBackground.jng} +0 -0
@@ -0,0 +1 @@
1
+ <component lightweight="true"><attach event="ondocumentready" onevent="IE7.init()"/></component>
@@ -1,17 +1,13 @@
1
- /* Prototype JavaScript framework, version 1.4.0
1
+ /* Prototype JavaScript framework, version 1.5.0_pre1
2
2
  * (c) 2005 Sam Stephenson <sam@conio.net>
3
3
  *
4
- * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
5
- * against the source tree, available from the Prototype darcs repository.
6
- *
7
4
  * Prototype is freely distributable under the terms of an MIT-style license.
8
- *
9
5
  * For details, see the Prototype web site: http://prototype.conio.net/
10
6
  *
11
7
  /*--------------------------------------------------------------------------*/
12
8
 
13
9
  var Prototype = {
14
- Version: '1.4.0',
10
+ Version: '1.5.0_pre1',
15
11
  ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
16
12
 
17
13
  emptyFunction: function() {},
@@ -120,26 +116,49 @@ PeriodicalExecuter.prototype = {
120
116
  }
121
117
  }
122
118
  }
119
+ Object.extend(String.prototype, {
120
+ gsub: function(pattern, replacement) {
121
+ var result = '', source = this, match;
122
+ replacement = arguments.callee.prepareReplacement(replacement);
123
+
124
+ while (source.length > 0) {
125
+ if (match = source.match(pattern)) {
126
+ result += source.slice(0, match.index);
127
+ result += (replacement(match) || '').toString();
128
+ source = source.slice(match.index + match[0].length);
129
+ } else {
130
+ result += source, source = '';
131
+ }
132
+ }
133
+ return result;
134
+ },
123
135
 
124
- /*--------------------------------------------------------------------------*/
136
+ sub: function(pattern, replacement, count) {
137
+ replacement = this.gsub.prepareReplacement(replacement);
138
+ count = count === undefined ? 1 : count;
125
139
 
126
- function $() {
127
- var elements = new Array();
140
+ return this.gsub(pattern, function(match) {
141
+ if (--count < 0) return match[0];
142
+ return replacement(match);
143
+ });
144
+ },
128
145
 
129
- for (var i = 0; i < arguments.length; i++) {
130
- var element = arguments[i];
131
- if (typeof element == 'string')
132
- element = document.getElementById(element);
146
+ scan: function(pattern, iterator) {
147
+ this.gsub(pattern, iterator);
148
+ return this;
149
+ },
133
150
 
134
- if (arguments.length == 1)
135
- return element;
151
+ truncate: function(length, truncation) {
152
+ length = length || 30;
153
+ truncation = truncation === undefined ? '...' : truncation;
154
+ return this.length > length ?
155
+ this.slice(0, length - truncation.length) + truncation : this;
156
+ },
136
157
 
137
- elements.push(element);
138
- }
158
+ strip: function() {
159
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
160
+ },
139
161
 
140
- return elements;
141
- }
142
- Object.extend(String.prototype, {
143
162
  stripTags: function() {
144
163
  return this.replace(/<\/?[^>]+>/gi, '');
145
164
  },
@@ -203,12 +222,35 @@ Object.extend(String.prototype, {
203
222
  },
204
223
 
205
224
  inspect: function() {
206
- return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'";
225
+ return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'";
207
226
  }
208
227
  });
209
228
 
229
+ String.prototype.gsub.prepareReplacement = function(replacement) {
230
+ if (typeof replacement == 'function') return replacement;
231
+ var template = new Template(replacement);
232
+ return function(match) { return template.evaluate(match) };
233
+ }
234
+
210
235
  String.prototype.parseQuery = String.prototype.toQueryParams;
211
236
 
237
+ var Template = Class.create();
238
+ Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
239
+ Template.prototype = {
240
+ initialize: function(template, pattern) {
241
+ this.template = template.toString();
242
+ this.pattern = pattern || Template.Pattern;
243
+ },
244
+
245
+ evaluate: function(object) {
246
+ return this.template.gsub(this.pattern, function(match) {
247
+ var before = match[1];
248
+ if (before == '\\') return match[2];
249
+ return before + (object[match[3]] || '').toString();
250
+ });
251
+ }
252
+ }
253
+
212
254
  var $break = new Object();
213
255
  var $continue = new Object();
214
256
 
@@ -375,8 +417,7 @@ var Enumerable = {
375
417
 
376
418
  var collections = [this].concat(args).map($A);
377
419
  return this.map(function(value, index) {
378
- iterator(value = collections.pluck(index));
379
- return value;
420
+ return iterator(collections.pluck(index));
380
421
  });
381
422
  },
382
423
 
@@ -662,7 +703,8 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
662
703
  setRequestHeaders: function() {
663
704
  var requestHeaders =
664
705
  ['X-Requested-With', 'XMLHttpRequest',
665
- 'X-Prototype-Version', Prototype.Version];
706
+ 'X-Prototype-Version', Prototype.Version,
707
+ 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*'];
666
708
 
667
709
  if (this.options.method == 'post') {
668
710
  requestHeaders.push('Content-type',
@@ -831,22 +873,48 @@ Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), {
831
873
  this.updater = new Ajax.Updater(this.container, this.url, this.options);
832
874
  }
833
875
  });
876
+ function $() {
877
+ var results = [], element;
878
+ for (var i = 0; i < arguments.length; i++) {
879
+ element = arguments[i];
880
+ if (typeof element == 'string')
881
+ element = document.getElementById(element);
882
+ results.push(Element.extend(element));
883
+ }
884
+ return results.length < 2 ? results[0] : results;
885
+ }
886
+
834
887
  document.getElementsByClassName = function(className, parentElement) {
835
888
  var children = ($(parentElement) || document.body).getElementsByTagName('*');
836
889
  return $A(children).inject([], function(elements, child) {
837
890
  if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
838
- elements.push(child);
891
+ elements.push(Element.extend(child));
839
892
  return elements;
840
893
  });
841
894
  }
842
895
 
843
896
  /*--------------------------------------------------------------------------*/
844
897
 
845
- if (!window.Element) {
898
+ if (!window.Element)
846
899
  var Element = new Object();
900
+
901
+ Element.extend = function(element) {
902
+ if (!element) return;
903
+
904
+ if (!element._extended && element.tagName && element != window) {
905
+ var methods = Element.Methods;
906
+ for (property in methods) {
907
+ var value = methods[property];
908
+ if (typeof value == 'function')
909
+ element[property] = value.bind(null, element);
910
+ }
911
+ }
912
+
913
+ element._extended = true;
914
+ return element;
847
915
  }
848
916
 
849
- Object.extend(Element, {
917
+ Element.Methods = {
850
918
  visible: function(element) {
851
919
  return $(element).style.display != 'none';
852
920
  },
@@ -882,6 +950,19 @@ Object.extend(Element, {
882
950
  setTimeout(function() {html.evalScripts()}, 10);
883
951
  },
884
952
 
953
+ replace: function(element, html) {
954
+ element = $(element);
955
+ if (element.outerHTML) {
956
+ element.outerHTML = html.stripScripts();
957
+ } else {
958
+ var range = element.ownerDocument.createRange();
959
+ range.selectNodeContents(element);
960
+ element.parentNode.replaceChild(
961
+ range.createContextualFragment(html.stripScripts()), element);
962
+ }
963
+ setTimeout(function() {html.evalScripts()}, 10);
964
+ },
965
+
885
966
  getHeight: function(element) {
886
967
  element = $(element);
887
968
  return element.offsetHeight;
@@ -920,6 +1001,13 @@ Object.extend(Element, {
920
1001
  return $(element).innerHTML.match(/^\s*$/);
921
1002
  },
922
1003
 
1004
+ childOf: function(element, ancestor) {
1005
+ element = $(element), ancestor = $(ancestor);
1006
+ while (element = element.parentNode)
1007
+ if (element == ancestor) return true;
1008
+ return false;
1009
+ },
1010
+
923
1011
  scrollTo: function(element) {
924
1012
  element = $(element);
925
1013
  var x = element.x ? element.x : element.offsetLeft,
@@ -1013,7 +1101,9 @@ Object.extend(Element, {
1013
1101
  element.style.overflow = element._overflow;
1014
1102
  element._overflow = undefined;
1015
1103
  }
1016
- });
1104
+ }
1105
+
1106
+ Object.extend(Element, Element.Methods);
1017
1107
 
1018
1108
  var Toggle = new Object();
1019
1109
  Toggle.display = Element.toggle;
@@ -1148,6 +1238,116 @@ Element.ClassNames.prototype = {
1148
1238
  }
1149
1239
 
1150
1240
  Object.extend(Element.ClassNames.prototype, Enumerable);
1241
+ var Selector = Class.create();
1242
+ Selector.prototype = {
1243
+ initialize: function(expression) {
1244
+ this.params = {classNames: []};
1245
+ this.expression = expression.toString().strip();
1246
+ this.parseExpression();
1247
+ this.compileMatcher();
1248
+ },
1249
+
1250
+ parseExpression: function() {
1251
+ function abort(message) { throw 'Parse error in selector: ' + message; }
1252
+
1253
+ if (this.expression == '') abort('empty expression');
1254
+
1255
+ var params = this.params, expr = this.expression, match, modifier, clause, rest;
1256
+ while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {
1257
+ params.attributes = params.attributes || [];
1258
+ params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''});
1259
+ expr = match[1];
1260
+ }
1261
+
1262
+ if (expr == '*') return this.params.wildcard = true;
1263
+
1264
+ while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {
1265
+ modifier = match[1], clause = match[2], rest = match[3];
1266
+ switch (modifier) {
1267
+ case '#': params.id = clause; break;
1268
+ case '.': params.classNames.push(clause); break;
1269
+ case '':
1270
+ case undefined: params.tagName = clause.toUpperCase(); break;
1271
+ default: abort(expr.inspect());
1272
+ }
1273
+ expr = rest;
1274
+ }
1275
+
1276
+ if (expr.length > 0) abort(expr.inspect());
1277
+ },
1278
+
1279
+ buildMatchExpression: function() {
1280
+ var params = this.params, conditions = [], clause;
1281
+
1282
+ if (params.wildcard)
1283
+ conditions.push('true');
1284
+ if (clause = params.id)
1285
+ conditions.push('element.id == ' + clause.inspect());
1286
+ if (clause = params.tagName)
1287
+ conditions.push('element.tagName.toUpperCase() == ' + clause.inspect());
1288
+ if ((clause = params.classNames).length > 0)
1289
+ for (var i = 0; i < clause.length; i++)
1290
+ conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')');
1291
+ if (clause = params.attributes) {
1292
+ clause.each(function(attribute) {
1293
+ var value = 'element.getAttribute(' + attribute.name.inspect() + ')';
1294
+ var splitValueBy = function(delimiter) {
1295
+ return value + ' && ' + value + '.split(' + delimiter.inspect() + ')';
1296
+ }
1297
+
1298
+ switch (attribute.operator) {
1299
+ case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break;
1300
+ case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break;
1301
+ case '|=': conditions.push(
1302
+ splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect()
1303
+ ); break;
1304
+ case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break;
1305
+ case '':
1306
+ case undefined: conditions.push(value + ' != null'); break;
1307
+ default: throw 'Unknown operator ' + attribute.operator + ' in selector';
1308
+ }
1309
+ });
1310
+ }
1311
+
1312
+ return conditions.join(' && ');
1313
+ },
1314
+
1315
+ compileMatcher: function() {
1316
+ this.match = new Function('element', 'if (!element.tagName) return false; \
1317
+ return ' + this.buildMatchExpression());
1318
+ },
1319
+
1320
+ findElements: function(scope) {
1321
+ var element;
1322
+
1323
+ if (element = $(this.params.id))
1324
+ if (this.match(element))
1325
+ if (!scope || Element.childOf(element, scope))
1326
+ return [element];
1327
+
1328
+ scope = (scope || document).getElementsByTagName(this.params.tagName || '*');
1329
+
1330
+ var results = [];
1331
+ for (var i = 0; i < scope.length; i++)
1332
+ if (this.match(element = scope[i]))
1333
+ results.push(Element.extend(element));
1334
+
1335
+ return results;
1336
+ },
1337
+
1338
+ toString: function() {
1339
+ return this.expression;
1340
+ }
1341
+ }
1342
+
1343
+ function $$() {
1344
+ return $A(arguments).map(function(expression) {
1345
+ return expression.strip().split(/\s+/).inject([null], function(results, expr) {
1346
+ var selector = new Selector(expr);
1347
+ return results.map(selector.findElements.bind(selector)).flatten();
1348
+ });
1349
+ }).flatten();
1350
+ }
1151
1351
  var Field = {
1152
1352
  clear: function() {
1153
1353
  for (var i = 0; i < arguments.length; i++)
@@ -2,9 +2,12 @@
2
2
  zeroth_attachments:
3
3
  id: 0
4
4
  elt_id: mail
5
+ created_on: 2006-03-02
5
6
  first_attachments:
6
7
  id: 1
7
8
  elt_id: mail
9
+ created_on: 2006-03-02
8
10
  another_attachments:
9
11
  id: 2
10
12
  elt_id: mail
13
+ created_on: 2006-03-02
@@ -25,3 +25,4 @@ Content-Length: 1007
25
25
  Lines: 18
26
26
 
27
27
  Test d'envoi de mail!
28
+ je teste en même temps les accents unicode!
@@ -3,52 +3,66 @@ first_person:
3
3
  id: first
4
4
  name: first
5
5
  email: manu@localhost
6
+ created_on: 2006-03-02
6
7
  echarp:
7
8
  id: echarp
8
9
  name: echarp
9
10
  email: manu@noos.fr
11
+ created_on: 2006-03-02
10
12
  another_person:
11
13
  id: second
12
14
  name: second
15
+ created_on: 2006-03-02
13
16
  bob:
14
17
  id: bob
15
18
  name: bob
16
19
  email: bob@test.com
20
+ created_on: 2006-03-02
17
21
  bob_other:
18
22
  id: bob_other
19
23
  name: bob_other
24
+ created_on: 2006-03-02
20
25
  bob2_person:
21
26
  id: bob2
22
27
  name: bob2
28
+ created_on: 2006-03-02
23
29
  bob3_person:
24
30
  id: bob3
25
31
  name: bob3
32
+ created_on: 2006-03-02
26
33
 
27
34
  existingbob:
28
35
  id: 1000002
29
36
  name: existingbob
37
+ created_on: 2006-03-02
30
38
  longbob:
31
39
  id: 1000003
32
40
  name: longbob
33
41
  email: longbob@test.com
42
+ created_on: 2006-03-02
34
43
 
35
44
  deletebob1:
36
45
  id: 1000004
37
46
  name: deletebob1
38
47
  email: deletebob1@test.com
48
+ created_on: 2006-03-02
39
49
 
40
50
  deletebob2:
41
51
  id: 1000005
42
52
  name: deletebob2
43
53
  email: deletebob2@test.com
54
+ created_on: 2006-03-02
44
55
 
45
56
  noName:
46
57
  id: noName
47
58
  name: ""
59
+ created_on: 2006-03-02
48
60
  justForTest:
49
61
  id: justForTest
50
62
  name: hugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhugebobhug
63
+ created_on: 2006-03-02
51
64
  bo:
52
65
  id: bo
53
66
  name: bo
67
+ created_on: 2006-03-02
54
68
 
@@ -10,8 +10,8 @@ class AccountController; def rescue_action(e) raise e end; end
10
10
 
11
11
  class AccountControllerTest < Test::Unit::TestCase
12
12
 
13
- #fixtures :people, LoginEngine.config(:user_table).to_sym
14
- fixtures :people, :users, :subscribers
13
+ fixtures :people, LoginEngine.config(:user_table).to_sym, :subscribers
14
+ #fixtures :people, :users
15
15
 
16
16
  def setup
17
17
  LoginEngine::CONFIG[:salt] = "test-salt"
@@ -136,6 +136,7 @@ class AccountControllerTest < Test::Unit::TestCase
136
136
  def test_email_protect
137
137
  LoginEngine::CONFIG[:use_email_notification] = true
138
138
 
139
+
139
140
  ActionMailer::Base.deliveries = []
140
141
 
141
142
  #@request.session['return-to'] = "/bogus/location"
@@ -33,5 +33,7 @@ class MailNotifyTest < Test::Unit::TestCase
33
33
  assert elt.save
34
34
 
35
35
  assert_equal 1, ActionMailer::Base.deliveries.size
36
+ #puts ActionMailer::Base.deliveries[0]
36
37
  end
37
38
  end
39
+
@@ -7,11 +7,6 @@ class MailTest < Test::Unit::TestCase
7
7
  @mail = Mail.find(1)
8
8
  end
9
9
 
10
- # Replace this with your real tests.
11
- def test_truth
12
- assert_kind_of Mail, @mail
13
- end
14
-
15
10
  def test_receive
16
11
  ActionMailer::Base.deliveries = []
17
12
 
@@ -20,6 +15,8 @@ class MailTest < Test::Unit::TestCase
20
15
  deliveredMailsCount = ActionMailer::Base.deliveries.size
21
16
 
22
17
  mailFile = TMail::Mail.parse(read_fixture('mail_ruby').to_s)
18
+ #print "mailFile envelope-to: ", mailFile["envelope-to"]
19
+ #puts
23
20
  elt = Elt.new
24
21
  elt.receive(mailFile)
25
22
 
@@ -43,6 +40,8 @@ class MailTest < Test::Unit::TestCase
43
40
 
44
41
  assert_equal (mailsCount + 2), Mail.count
45
42
  assert_equal (eltsCount + 2), Elt.count
43
+
44
+ assert_equal 'TEST_with_subject', Elt.find('TEST_with_subject').id
46
45
  end
47
46
 
48
47
  def test_receiveWithAttachment
@@ -91,6 +90,28 @@ class MailTest < Test::Unit::TestCase
91
90
  assert_equal elt.created_on, ActionMailer::Base.deliveries[0].date
92
91
  end
93
92
 
93
+ # Not used, just make sure mails are entered chronologically
94
+ def est_receiveChildThenParent
95
+ ActionMailer::Base.deliveries = []
96
+
97
+ elt = Elt.new
98
+ mailFile = TMail::Mail.parse(read_fixture('mail_rubyChild').to_s)
99
+ elt.receive(mailFile)
100
+
101
+ ActionMailer::Base.deliveries = []
102
+ mailsCount = Mail.count
103
+ eltsCount = Elt.count
104
+
105
+ mailFileChild = TMail::Mail.parse(read_fixture('mail_ruby').to_s)
106
+ eltParent = Elt.new
107
+ eltParent.receive(mailFileChild)
108
+
109
+ assert_equal (mailsCount + 1), Mail.count
110
+ assert_equal (eltsCount + 1), Elt.count
111
+
112
+ assert_equal eltParent.id, elt.parent_id
113
+ end
114
+
94
115
  def test_re_receive
95
116
  ActionMailer::Base.deliveries = []
96
117
 
@@ -111,7 +132,7 @@ class MailTest < Test::Unit::TestCase
111
132
  assert_equal eltsCount, Elt.count
112
133
  assert_equal deliveredMailsCount, ActionMailer::Base.deliveries.size
113
134
  end
114
-
135
+
115
136
  def test_receive_change_ID
116
137
  ActionMailer::Base.deliveries = []
117
138
 
@@ -124,7 +145,14 @@ class MailTest < Test::Unit::TestCase
124
145
  deliveredMailsCount = ActionMailer::Base.deliveries.size
125
146
 
126
147
  mail = ActionMailer::Base.deliveries[1]
148
+ #puts "mail.methods: ", mail.methods
149
+ #puts mail.to_yaml
150
+ #puts mail.add_message_id
151
+ #print "mail.message_Id: ", mail.message_id
152
+ #puts
127
153
  mail.message_id = "<truc#{mail.message_id[1..-1]}"
154
+ #print "new mail.message_Id: ", mail.message_id
155
+ #puts
128
156
 
129
157
  elt = Elt.new
130
158
  elt.receive(mail)
@@ -133,5 +161,30 @@ class MailTest < Test::Unit::TestCase
133
161
  assert_equal eltsCount, Elt.count
134
162
  assert_equal deliveredMailsCount, ActionMailer::Base.deliveries.size
135
163
  end
164
+
165
+ def test_receive_unicode
166
+ ActionMailer::Base.deliveries = []
167
+
168
+ mailsCount = Mail.count
169
+ eltsCount = Elt.count
170
+ deliveredMailsCount = ActionMailer::Base.deliveries.size
171
+
172
+
173
+ mailFile = TMail::Mail.parse(read_fixture('mail_ruby').to_s)
174
+ elt = Elt.new
175
+ elt.receive(mailFile)
176
+
177
+ #print mailFile.to_yaml
178
+ #puts
179
+ #puts mailFile.type_param('charset')
180
+
181
+ #puts elt.body
182
+
183
+ #puts elt.body =~ /même/
184
+ assert elt.body =~ /même/
185
+
186
+ #mail = ActionMailer::Base.deliveries[1]
187
+ #puts mail.to_yaml
188
+ end
136
189
  end
137
190
 
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
3
  class PersonTest < Test::Unit::TestCase
4
4
  #fixtures :people, LoginEngine.config(:user_table).to_sym
5
- fixtures :people, :users, :subscribers
5
+ fixtures :people, :users, :elts, :mails, :attachments, :subscribers
6
6
 
7
7
  def setup
8
8
  @person = Person.find(:first)
@@ -1,7 +1,99 @@
1
1
  *SVN*
2
2
 
3
+
4
+ -----
5
+ 1.1.1
6
+
7
+ - Fixed migration rake task failing when given a specific version (Ticket #115)
8
+ - Added new rake task "test:engines" which will test engines (and other plugins) but ensure that the test database is cloned from development beforehand (Ticket #125)
9
+ - Fixed issue where 'engine_schema_info' table was included in schema dumps (Ticket #87)
10
+ - Fixed multi-part emails (Ticket #121)
11
+ - Added an 'install.rb' file to new engines created by the bundled generator, which installs the engines plugin automatically if it doesn't already exist (Ticket #122)
12
+ - Added a default VERSION module to generated engines (Ticket #123)
13
+ - Refactored copying of engine's public files to a method of an Engine instance. You can now call Engines.get(:engine_name).copy_public_files (Ticket #108)
14
+ - Changed engine generator templates from .rb files to .erb files (Ticket #106)
15
+ - Fixed the test_helper.erb file to use the correct testing extensions and not load any schema - the schema will be cloned automatically via rake test:engines
16
+ - Fixed problem when running with Rails 1.1.1 where version wasn't determined correctly (Ticket #129)
17
+ - Fixed bug preventing engines from loading when both Rails 1.1.0 and 1.1.1 gems are installed and in use.
18
+ - Updated version (d'oh!)
19
+
20
+
21
+ -----
22
+ 1.1.0
23
+
24
+ - Improved regexp matching for Rails 1.0 engines with peculiar paths
25
+ - Engine instance objects can be accessed via Engines[:name], an alias for Engines.get(:name) (Ticket #99)
26
+ - init_engine.rb is now processed as the final step in the Engine.start process, so it can access files within the lib directory, which is now in the $LOAD_PATH at that point. (Ticket #99)
27
+ - Clarified MIT license (Ticket #98)
28
+ - Updated Rake tasks to integrate smoothly with Rails 1.1 namespaces
29
+ - Changed the version to "1.1.0 (svn)"
30
+ - Added more information about using the plugin with Edge Rails to the README
31
+ - moved extensions into lib/engines/ directory to enable use of Engines module in extension code.
32
+ - Added conditional require_or_load method which attempts to detect the current Rails version. To use the Edge Rails version of the loading mechanism, add the line:
33
+ Engines.config :edge, true
34
+ to your environment.rb file.
35
+ - Merged changes from /branches/edge and /branches/rb_1.0 into /trunk
36
+ - engine_schema_info now respects the prefix/suffixes set for ActiveRecord::Base (Ticket #67)
37
+ - added ActiveRecord::Base.wrapped_table_name(name) method to assist in determining the correct table name
38
+
39
+
40
+ -----
41
+ 1.0.6
42
+
43
+ - Added ability to determine version information for engines: rake engine_info
44
+ - Added a custom logger for the Engines module, to stop pollution of the Rails logs.
45
+ - Added some more tests (in particular, see rails_engines/applications/engines_test).
46
+ - Another attempt at solving Ticket #53 - controllers and helpers should now be loadable from modules, and if a full path (including RAILS_ROOT/ENGINES_ROOT) is given, it should be safely stripped from the require filename such that corresponding files can be located in any active engines. In other words, controller/helper overloading should now completely work, even if the controllers/helpers are in modules.
47
+ - Added (finally) patch from Ticket #22 - ActionMailer helpers should now load
48
+ - Removed support for Engines.start :engine, :engine_name => 'whatever'. It was pointless.
49
+ - Fixed engine name referencing; engine_stylesheet/engine_javascript can now happily use shorthand engine names (i.e. :test == :test_engine) (Ticket #45)
50
+ - Fixed minor documentation error ('Engine.start' ==> 'Engines.start') (Ticket #57)
51
+ - Fixed double inclusion of RAILS_ROOT in engine_migrate rake task (Ticket #61)
52
+ - Added ability to force config values even if given as a hash (Ticket #62)
53
+
54
+
55
+ -----
56
+ 1.0.5
57
+
58
+ - Fixed bug stopping fixtures from loading with PostgreSQL
59
+
60
+
61
+ -----
62
+ 1.0.4
63
+
64
+ - Another attempt at loading controllers within modules (Ticket #56)
65
+
66
+
67
+ -----
68
+ 1.0.3
69
+
70
+ - Fixed serious dependency bug stopping controllers being loaded (Ticket #56)
71
+
72
+
73
+ -----
74
+ 1.0.2
75
+
76
+ - Fixed bug with overloading controllers in modules from /app directory
77
+ - Fixed exception thrown when public files couldn't be created; exception is now logged (Ticket #52)
78
+ - Fixed problem with generated test_helper.rb file via File.expand_path (Ticket #50)
79
+
80
+
81
+ -----
82
+ 1.0.1
83
+
84
+ - Added engine generator for creation of new engines
85
+ - Fixed 'Engine' typo in README
86
+ - Fixed bug in fixtures extensions
87
+ - Fixed /lib path management bug
88
+ - Added method to determine public directory location from Engine object
89
+ - Fixed bug in the error message in get_engine_dir()
90
+ - Added proper component loading
3
91
  - Added preliminary tests for the config() methods module
4
92
 
93
+
94
+ -----
95
+ pre-v170
96
+
5
97
  - Fixed copyright notices to point to DHH, rather than me.
6
98
  - Moved extension require statements into lib/engines.rb, so the will be loaded if another module/file calls require 'engines
7
99
  - Added a CHANGELOG file (this file)