public
Description: A collection of RSpec matchers to be used with the Ruby on Rails project
Clone URL: git://github.com/joshknowles/rspec-on-rails-matchers.git
Search Repo:
Added have_form_putting_to.


git-svn-id: https://rspec-on-rails-matchers.googlecode.com/svn/trunk@24 
11e6f158-dd3c-0410-a69b-4d739fb74d9d
joshknowles (author)
Sun Mar 02 21:22:23 -0800 2008
commit  89e73dc828d96b960b03fa3801a058c8bf3400e9
tree    02870ab7cae47bd8496ed4680e409ef39b46724a
parent  33f44e4d7242d05fa9f1a25556e0f4d11b713feb
...
4
5
6
 
7
8
9
...
4
5
6
7
8
9
10
0
@@ -4,6 +4,7 @@
0
 Trunk
0
 -----
0
 
0
+* 2008/03/02 - Added have_form_putting_to(url_or_path) - Patch by unknown google code submitter
0
 * 2008/03/02 - Added should observe (Luke Melia)
0
 * 2008/03/02 - Patched validates_length_of to use within to be consistent with Rails (Matt Pelletier)
0
 * 2007/01/03 - Initial Public Release
0
...
63
64
65
 
 
66
67
68
...
63
64
65
66
67
68
69
70
0
@@ -63,6 +63,8 @@
0
     response.should have_form_posting_to(url_or_path)
0
     TM snippet: [hfpt + tab]
0
 
0
+ response.should have_form_putting_to(url_or_path)
0
+
0
     response.should have_text_field_for(:attribute)
0
     TM snippet: [htff + tab]
0
 
...
7
8
9
 
 
 
 
 
 
 
10
11
12
...
7
8
9
10
11
12
13
14
15
16
17
18
19
0
@@ -7,6 +7,13 @@
0
         end
0
       end
0
 
0
+ def have_form_puting_to(url_or_path, id)
0
+ return simple_matcher("have a form submitting via PUT to '#{url_or_path}/#{id}'") do |response|
0
+ have_tag("form[method=post][action=#{url_or_path}/#{id}]").matches?(response)
0
+ have_tag("input[name=_method][type=hidden][value=put]").matches?(response)
0
+ end
0
+ end
0
+
0
       def have_label_for(attribute, text)
0
         return simple_matcher("have a label for '#{attribute}' with value of '#{text}'") do |response|
0
           have_tag("label[for=#{attribute}]").matches?(response)

Comments

    No one has commented yet.