This project is archived and is in readonly mode.
Prototype helpers should generate Element.insert instead of Insertion.new
-
Emilio Tagua
- Assigned user set to DHH
-
Emilio Tagua
Third time updating the patch so it can be merged...
Any comments?
-
Pratik
- Assigned user changed from DHH to Pratik
-
Jeremy Kemper
- State changed from new to open
- Milestone changed from 2.x to 2.1.1
-
Mislav
+1
There is a typo in RDoc: missing opening double quote here:
new Element.insert("list", { bottom: <li>Some item</li>" });The patch seems a bit large and certain parts very hackish. Still, I haven't had time to actually study RJS code in depth. Are you sure this is in its simplest form?
-
Emilio Tagua
Mislav, thanks for your feedback.
I have fixed the typo in docrails:
http://github.com/lifo/docrails/...
About the patch being large, i don't quite agree, i did have to change tests to match the new output and update docs.
I do agree selector_assertions is a very hackish helper, as it was before the patch. I'll try to work on it and create a new ticket with the results.
Thanks again for you comments.
-
Emilio Tagua
I've improved selector_assertion by: - Making use of constants that were defined but never used. - Improving the readability of the code. - Adding test to untested code. - Simplifying Regexps.
This second patch applies on the current version, that would be after the first patch of this ticket was commited.
Anyway, the former patch works well and the later one is just and improvement to code that was already in.
-
Mislav
The code is a bit shorter, nicer, and adds a missing test.
+1 from me
-
Pratik
First patch applied in http://github.com/rails/rails/co...
-
Repository
- State changed from open to resolved
(from [11eb29f60ab79caf22f7ca715500e32d9a1b03a2]) Make assert_select_rjs code more readable, make use of unused constants and use more simple Regexps.
[#540 Prototype helpers should generate Element.insert instead of Insertion.new state:resolved]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
-
Jeremy Kemper
- State changed from resolved to open
This caused a regression that wasn't covered by a test case.
-
Emilio Tagua
I have ran the test against the branches 2-1-stable and 2-0-stable (before any of these patches were commited), and the test fails on both, i can't see either were the previous code verified the double insertion to raise any error.
By the way, should an error be raised in that situation?
-
Pratik
- Assigned user changed from Pratik to Jeremy Kemper
-
Jeremy Kemper
- Milestone changed from 2.1.1 to 2.1.3
-
Repository
- State changed from open to resolved
(from [dce0da77e7ef602f7420f43c0d1aba5a99a00bdb]) Fix assert_select_rjs not checking id for inserts [#540 Prototype helpers should generate Element.insert instead of Insertion.new state:resolved] http://github.com/rails/rails/co...
