Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (28 sloc) 1.37 kB
365ff21 @kucaahbe Немного Михалка не помешает
kucaahbe authored
1 Test views, be true! :)
2 =======================
3
fe5b2e0 @kucaahbe I love to update readme
kucaahbe authored
4 [![Build Status](http://travis-ci.org/kucaahbe/rspec2-rails-views-matchers.png)](http://travis-ci.org/kucaahbe/rspec2-rails-views-matchers)
365ff21 @kucaahbe Немного Михалка не помешает
kucaahbe authored
5
fe5b2e0 @kucaahbe I love to update readme
kucaahbe authored
6 [![Mikhalok](http://investigator.org.ua/wp-content/uploads/01_500_liapis_powe-300x192.jpg)](http://www.myspace.com/lyapis "Lyapis Trubetskoy ska-punk band")
365ff21 @kucaahbe Немного Михалка не помешает
kucaahbe authored
7
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
8 Why?
9 ===
10
11 * you need to test some complex views
12 * and you want to use rspec2
13 * and assert\_select seems is something strange to you
14 * [rspec-rails](http://github.com/rspec/rspec-rails) for some reason does not provide instruments for testing views
15 * you need user-firendly output in error messages
16
17 Install
18 -------
19
20 add to your Gemfile(in group :test :) ):
21
d653610 @kucaahbe README markdown fix
kucaahbe authored
22 gem 'rspec2-rails-views-matchers'
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
23
24 Usage
25 -----
26
27 some examples:
28
d653610 @kucaahbe README markdown fix
kucaahbe authored
29 rendered.should have_tag('form',:with => {:action => user_path, :method => 'post'}) do
30 with_tag "input", :with => { :name => "user[email]", :type => 'email' }
31 with_tag "input#special_submit", :count => 1
32 without_tag "h1", :text => 'unneeded tag'
33 without_tag "p", :text => /content/i
34 end
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
35
36 More info
37 ---------
38
330f0c7 @kucaahbe README updated
kucaahbe authored
39 You can find [on RubyDoc](http://rubydoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers), take a look at {RSpec::Matchers#have\_tag have\_tag} method.
40
41 Also, please read {file:docs/CHANGELOG.md CHANGELOG}, it might be helpful.
Something went wrong with that request. Please try again.