Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

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

Open
bratke opened this issue May 29, 2010 · 4 comments

Comments

@bratke
Copy link

bratke commented May 29, 2010

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
Copy link
Owner

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

@bratke
Copy link
Author

bratke commented May 29, 2010

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
Copy link
Owner

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

@bratke
Copy link
Author

bratke commented May 29, 2010

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants