Class: Spec::Rails::Example::WebratExampleGroup
- Inherits:
-
BaseWebratExampleGroup
- Object
- ActionController::IntegrationTest
- BaseWebratExampleGroup
- Spec::Rails::Example::WebratExampleGroup
- Defined in:
- lib/webrat_rspec_rails/webrat_example_group.rb
Instance Method Summary collapse
- #current_path ⇒ Object
- #field_named(name, *field_types) ⇒ Object
- #get_link(text_or_title_or_id) ⇒ Object
Methods inherited from BaseWebratExampleGroup
Instance Method Details
#current_path ⇒ Object
5 6 7 |
# File 'lib/webrat_rspec_rails/webrat_example_group.rb', line 5 def current_path current_url.blank? ? "" : URI.parse(current_url).path end |
#field_named(name, *field_types) ⇒ Object
17 18 19 |
# File 'lib/webrat_rspec_rails/webrat_example_group.rb', line 17 def field_named(name, *field_types) Webrat::Locators::FieldNamedLocator.new(webrat_session, current_dom, name, *field_types).locate end |
#get_link(text_or_title_or_id) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/webrat_rspec_rails/webrat_example_group.rb', line 9 def get_link(text_or_title_or_id) current_dom.css("a").find do |link| link.text == text_or_title_or_id || link["title"] == text_or_title_or_id || link["id"] == text_or_title_or_id end end |