[rspec-users] rspec_on_rails_matchers

Ben Mabey ben at benmabey.com
Wed Jan 16 13:58:34 EST 2008

Sorry for spamming this list about this but I think everyone who could 
help me with this problem is on this list...  If there is a better place 
to post this question let me know.

Anyways, I am trying to use rspec_on_rails_matchers in my rails app to 
improve my view specs but I can't get them to work.  The helpers for the 
form tags never seem to be called.
I created a new Rails 2.0.2 app, installed RSpec and rspec_on_rails 
1.1.2, then installed the rspec_on_rails_matchers... FYI, I am using 
ruby 1.8.5 (2006-12-04 patchlevel 2).

I then created some simple scaffolding to have some view specs to play with:
./script/generate rspec_scaffold Animal kingdom:string name:string

Then running rake db:migrate, rake db:test:prepare, and rake spec will 
give me all green.  I then added the rspec_on_rails_matchers to my view 
spec.. so I had this:

I then removed one of my fields from my actual form to break the specs.  
The original spec with have_tag and with_tag did break but the 
rspec_on_rails_matcher version did not break!  In fact I can do the 
following and not even get it to break:

  it "should render new form" do
    render "/animals/new.html.erb"
    response.should have_form_posting_to(animals_path) do

Could someone please tell me what the painfully obvious thing that I am 
doing wrong is?  Or are the rspec_on_rails_matchers not working for 
other people?

This is my sample app that is giving me this odd behaviour:

Thanks in advance.


More information about the rspec-users mailing list