[rspec-users] Testing for particular CSS (i.e. display: none)
dchelimsky at gmail.com
Tue Sep 25 11:27:53 EDT 2007
On 9/25/07, David James <davidj503 at gmail.com> wrote:
> I have a page that hides elements using CSS display: none.
> test how the page loads initially: what is visible and what is not.
If the css is expressed in-line in the html, then you can do it like
so (example assumes a div with id foo that should be hidden):
response.should have_tag('div#foo[style=?]', /display:\s*none/)
have_tag wraps asset_select, so have a look at the assert_select docs
for more info
> Can I test this in RSpec? Or do I need to use something like Selenium?
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users