langalex / culerity

Culerity integrates Cucumber and Celerity in order to test your application's full stack including Javascript. Your Rails app doesn't have to run in JRuby.
http://groups.google.com/group/culerity-dev
MIT License
259 stars 33 forks source link

step 'When I follow "[link]"' finds wrong link, with celerity -v=0.7.7 and above #22

Open bratke opened 14 years ago

bratke commented 14 years ago

background: -culerity -v=0.2.10 -jruby -v=1.5.0 -ruby -v=ruby 1.8.7 (2009-06-12 patchlevel 174) -rails -v=2.3.5

behaviour: -the step does not fail it just finds wrong link -if I add a "puts _link.absolute_url" to the step the problem becomes obvious

workaround: -using celerity -v=0.7.6

is somebody able to reproduce this?

Regards

langalex commented 14 years ago

can you enlighten me on what happened when "the problem became obvious"?

bratke commented 14 years ago

Scenario: Check in Given I am logged in as "guenter" And I am on the page of location "location1" When I follow "Check-In" Then I should see "eingecheckt"

'When I follow "Check-In"' runs successfully in both cases, 'Then I should see "eingecheckt" fails if using celerity -v=0.7.7 and above

http://de.culerity/locations/location1_street_1_berlin/check_in is the output of "puts _link.absolute_url" in case -v=0.7.6, which triggers the correct action

http://de.culerity/users/guenter/home is the output of "puts _link.absolute_url" in case -v=0.7.9, which triggers the wrong action -> the next step fails

langalex commented 14 years ago

ok, and now the html/js. are you using any javascript to manipulate that link?

bratke commented 14 years ago

in detail:

the show.html of locations-controller gets page cached

somewhere in it there is a div class="location_action_fields_right"> /div>

and js-tag which looks like this: <% javascript_tag do %> $.getScript('<%= user_info_location_path(@location) %>'); <% end %>

this triggers the user_info(.rjs) -action which loads the check-in-link dynamically

page.replace_html '.location_action_fields_right', :partial => 'location_checkin_button'

it does look like a button, thatswhy it is not named link :)

but i also got this effect in another controller where no page-caching is used.