[rspec-users] how to write complex matchers

Yury Kotlyarov yura at brainhouse.ru
Thu Feb 12 23:02:51 EST 2009


Yury Kotlyarov wrote:
> SOLVED! just need to pass matched result to inner block. gist: 
> http://gist.github.com/62562
>
> Many thanks,
> Yury
>

I was wrong. It yields just one last line from the inner block. It 
passes following:

  it "should have form to create a new user" do
    render '/users/new'
    response.should have_form(users_path) do
      with_field_set 'Personal Information' do
        with_text_field 'wrong', 'wrong' # there is no such field 
with_text_field 'First Name', 'user[first_name]'
      end
    end
  end gist: http://gist.github.com/62562 TIA, Yury



More information about the rspec-users mailing list