Skip to content

Commit

Permalink
Fixed ajax bugs with dom_ids in nested partials.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspard committed Dec 15, 2011
1 parent ab16bb0 commit df93d14
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 9 deletions.
3 changes: 2 additions & 1 deletion History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fixed a bug when using [edit] in a list with [add].
* Fixed 'unknown this' bug in [calendar] when rendering in a [block].
* Enabled 'alt_class' to work on multiple elements ([each]).
* Fixed ajax bugs with dom_ids in nested partials.

== 1.1.3 2011-11-09

Expand Down Expand Up @@ -276,4 +277,4 @@
== 0.11.1 2009-04-03

* Minor enhancements
* Better testing of custom queries using latest querybuilder (0.5.2)
* Better testing of custom queries using latest querybuilder (0.5.2)
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Settings specified here will take precedence over those in config/environment.rb
config.log_level = :debug
config.log_level = :info

# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
Expand All @@ -24,4 +24,4 @@
# config.action_controller.asset_host = "http://assets.example.com"

# Disable delivery errors if you bad email addresses should just be ignored
# config.action_mailer.raise_delivery_errors = false
# config.action_mailer.raise_delivery_errors = false
10 changes: 10 additions & 0 deletions test/fixtures/files/TestNode.zafu
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@
</ul>
</div>

//! edit6
<div class='test' id='edit6' do='selenium' do='root'>
<h3>edit6</h3>
<p>Edit link after [block].</p>
<ul do='pages'>
<li do='each'><span class='title' do='title'/> <div do='block'>O:<span id='swap_span' do='if' test='origin' do='origin'/> <r:swap attr='origin' states=',bob' do='t'>swap</r:swap></div> <r:edit/></li>
<li do='form'><r:input name='title'/></li>
</ul>
</div>

<div class='test' id='toggle1' do='selenium'>
<h3>toggle1</h3>
<p>Toggle relation in list.</p>
Expand Down
8 changes: 4 additions & 4 deletions test/selenium/Drop/drop3.rsel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ assert_element_not_present 'drop33_26'

# Drag & Drop
set_timeout 4000
drag_and_drop_to_object "css=#drop13_21_26 > span.drag_handle", "drop32"
drag_and_drop_to_object "css=#drop12_21_26 > span.drag_handle", "drop32"
wait_for_element_present "drop33_26"
verify_text "drop33_26", "crocodiles"
# Unlink
Expand All @@ -14,13 +14,13 @@ wait_for_element_not_present "drop33_26"
# Restart

# Drag & Drop
drag_and_drop_to_object "css=#drop13_21_26 > span.drag_handle", "drop32"
drag_and_drop_to_object "css=#drop12_21_26 > span.drag_handle", "drop32"
wait_for_element_present "drop33_26"
verify_text "drop33_26", "crocodiles"

# Drag & Drop from other location
command 'setSpeed', 500
drag_and_drop_to_object "css=#drop13_11_12 > span.drag_handle", "drop32"
command 'setSpeed', 800
drag_and_drop_to_object "css=#drop12_11_12 > span.drag_handle", "drop32"
wait_for_element_present "drop33_12"
verify_text "drop33_12", "people"
command 'setSpeed', 0
Expand Down
53 changes: 53 additions & 0 deletions test/selenium/Edit/edit6.rsel
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@old_title = 'Collections'
@new_title = 'New Collections'

open '/oo/testnode37.html?test=edit6'
set_timeout 4000
assert_element_not_present 'edit61_title'
verify_text "css=#edit61_32 .title", @old_title

# swap block should work before edit
# swap
click 'css=#edit62_32 a'
wait_for_element_present 'swap_span'
verify_text "css=#edit62_32 span", 'bob'

# edit
click 'link=edit'
wait_for_element_present 'edit61_title'
type 'edit61_title', @new_title

# submit
click 'css=input[type=submit]'
wait_for_element_present 'swap_span'
verify_text "css=#edit61_32 .title", @new_title
verify_text "css=#edit62_32 span", 'bob'

# edit again
click 'link=edit'
wait_for_element_present 'edit61_title'

# cancel
click 'css=img[alt="cancel"]'
wait_for_element_not_present 'edit61_title'

# edit again
click 'link=edit'
wait_for_element_present 'edit61_title'
# Ensure we do proper ajax replacements
assert_element_not_present 'css=#edit6 form form'
type 'edit61_title', @old_title

# submit
click 'css=input[type=submit]'
wait_for_element_not_present 'edit61_title'
verify_text "css=#edit61_32 .title", @old_title

# swap block should work after edit
click 'css=#edit62_32 a'
wait_for_element_not_present 'swap_span'
verify_text "css=#edit61_32 .title", @old_title

# ensure changes are recorded
open '/oo/testnode37.html?test=edit6'
verify_text "css=#edit61_32 .title", @old_title
2 changes: 1 addition & 1 deletion test/selenium/Form/form1.rsel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@test_page = "/oo/testnode37.html?test=form1"
open @test_page
type "paginate1_tbl_title", "Hello World!"
type "add31_title", "Hello World!"
# submit
click_and_wait 'css=input[type=submit]'
# Redirected to new page
Expand Down
2 changes: 1 addition & 1 deletion test/selenium/Form/form2.rsel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open "/oo/testnode37.html?test=form2"
type "paginate1_tbl_title", "Heal the bugs!"
type "add31_title", "Heal the bugs!"
# submit
click_and_wait 'css=input[type=submit]'

Expand Down

0 comments on commit df93d14

Please sign in to comment.