Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technicalpickles/nice_assert_select
make assert_select nicer
https://github.com/technicalpickles/nice_assert_select
Last synced: 3 months ago
JSON representation
make assert_select nicer
- Host: GitHub
- URL: https://github.com/technicalpickles/nice_assert_select
- Owner: technicalpickles
- License: mit
- Created: 2009-02-18T21:59:31.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2009-02-19T08:52:42.000Z (almost 16 years ago)
- Last Synced: 2024-09-21T13:20:33.442Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 85.9 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= nice_assert_select
Tired of ugly assert_select calls?
assert_select "form[action=?][method=post]", sources_path do
assert_select "input[type=text][name=?]", 'source[name]'
assert_select "input[type=hidden][name=_method][value=put]"
assert_select "input[type=submit]"
endHow about some nice assert_selects?
assert_select form(:action => :post, :action => sources_path) do
assert_select text_field(:name => 'source[name]')
assert_select form_method_field(:put)
assert_select submit_button
end
nice_assert_select provides helpers for making the calls more rubyish and more readable. Currently, they are mostly limited to form related selectors that do attribute matching.form
text_field
hidden_field
password_field
form_method_field (this is the hidden field Rails uses for determing what HTTP method to use, since browsers are generally limited to GET and POST)
submit_buttonIt is by no means comprehensive, as it was extracted from a project which only needed these assert_selects.
== Installing
For Rails 2.1 and on, add this to your config/environment.rb:
config.gem 'technicalpickles-nice_assert_select', :lib => 'nice_assert_select', :source => 'http://gems.github.com'
== COPYRIGHT
Copyright (c) 2009 Josh Nichols. See LICENSE for details.