All,
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:
http://pastie.caboo.se/139655
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
with_text_field_for(:animal_kingdom)
with_text_field_for(:animal_name)
with_text_field_for(:some_non_existent_field)
with_text_field_for(:something_else_that_should_break_it)
end
end
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:
http://benmabey.com/rspec_on_rails_matchers_test_app.tar.bz
Thanks in advance.
-Ben