Permalink
Browse files

Ne selectionne pas les form.button_to

Galère à faire cette requête XPath, par contre j'ai enfin appris XPath :D (je
mettais pas de '' autour des chaînes, etc...)

(J'ai toujours le problème de Gedit qui enlève la dernière ligne...)
  • Loading branch information...
1 parent 8f1b027 commit 110383b4de0a98350ea71fb9c740dc2788693a49 @Dorian Dorian committed May 13, 2012
Showing with 3 additions and 6 deletions.
  1. +0 −1 spec/requests/news_spec.rb
  2. +3 −4 spec/support/common_helper.rb
  3. +0 −1 spec/support/user_session_helper.rb
@@ -47,4 +47,3 @@
page.should have_content news.title
end
end
-
@@ -11,10 +11,9 @@ def submit_form
end
def within_form attributes = {}
- xpath = attributes.map { |key, value| "@#{key}=\"#{value}\"" }.join(' and ')
- xpath = "[#{xpath}]" unless xpath.blank?
- within(:xpath, "//form#{xpath}") do
+ xpath = attributes.map { |key, value| " and @#{key}=\"#{value}\"" }.join
+ # Don't select the button_to forms (logout, delete, etc...)
+ within(:xpath, "//form[@class!='button_to'#{xpath}]") do
yield
end
end
-
@@ -7,4 +7,3 @@ def sign_in login, password
submit_form
end
end
-

0 comments on commit 110383b

Please sign in to comment.