Skip to content

Commit

Permalink
Test for display_with :link_to after edit
Browse files Browse the repository at this point in the history
  • Loading branch information
guigs committed Nov 19, 2012
1 parent a3b00ff commit d80bbd0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/integration/js_spec.rb
Expand Up @@ -648,6 +648,25 @@
within("#alt_money") { page.should have_content("€58.00") }
end

it "should keep link after edit with display_with :link_to" do
@user.save!
visit users_path
within("tr#user_#{@user.id} > .name > span") do
page.should have_content("Lucia")
page.should have_xpath("//a[contains(@href,'#{user_path(@user)}')]")
end
id = BestInPlace::Utils.build_best_in_place_id @user, :name
page.execute_script <<-JS
jQuery("#edit_#{@user.id}").click();
jQuery("##{id} input[name='name']").val('Maria Lucia');
jQuery("##{id} form").submit();
JS
within("tr#user_#{@user.id} > .name > span") do
page.should have_content("Maria Lucia")
page.should have_xpath("//a[contains(@href,'#{user_path(@user)}')]")
end
end

describe "display_with using a lambda" do


Expand Down

0 comments on commit d80bbd0

Please sign in to comment.