Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 76 lines (54 sloc) 3.053 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
663fb2d @kucaahbe readme addons
kucaahbe authored
14 * have_tag in [rspec-rails](http://github.com/rspec/rspec-rails) are deprecated now
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
15 * you need user-firendly output in error messages
16
663fb2d @kucaahbe readme addons
kucaahbe authored
17 Being true
18 ==========
19
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
20 Install
21 -------
22
23 add to your Gemfile(in group :test :) ):
24
d653610 @kucaahbe README markdown fix
kucaahbe authored
25 gem 'rspec2-rails-views-matchers'
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
26
27 Usage
28 -----
29
30 some examples:
31
d653610 @kucaahbe README markdown fix
kucaahbe authored
32 rendered.should have_tag('form',:with => {:action => user_path, :method => 'post'}) do
33 with_tag "input", :with => { :name => "user[email]", :type => 'email' }
34 with_tag "input#special_submit", :count => 1
35 without_tag "h1", :text => 'unneeded tag'
36 without_tag "p", :text => /content/i
37 end
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
38
663fb2d @kucaahbe readme addons
kucaahbe authored
39 additional list of defined matchers ("form" matchers)
40 -----------------------------------------------------
41
42 - [have_form](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:have_form)
43 - [with_checkbox](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_checkbox)
44 - [with_file_field](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_file_field)
45 - [with_hidden_field](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_hidden_field)
46 - [with_option](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_option)
47 - [with_password_field](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_password_field)
48 - [with_radio_button](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_radio_button)
49 - [with_select](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_select)
50 - [with_submit](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_submit)
51 - [with_text_area](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_text_area)
52 - [with_text_field](http://rdoc.info/github/kucaahbe/rspec2-rails-views-matchers/master/RSpec/Matchers:with_text_field)
53
54 and of course you can use <strong>without_</strong>matchers
55
a838b22 @kucaahbe rdoc=>markdown
kucaahbe authored
56 More info
57 ---------
58
330f0c7 @kucaahbe README updated
kucaahbe authored
59 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.
60
61 Also, please read {file:docs/CHANGELOG.md CHANGELOG}, it might be helpful.
663fb2d @kucaahbe readme addons
kucaahbe authored
62
63 Contribution
64 ============
65
66 1. fork
67 2. add tests for feature
68 3. write implementation
69 4. send pull request
70
71 Contributors
72 ============
73
74 - [Kelly Felkins](http://github.com/kellyfelkins)
75 - [Ryan Wilcox](http://github.com/rwilcox)
Something went wrong with that request. Please try again.