[Rails] Re: Use assert_select to test for the occurence of a string

2010-12-07 Thread Marnen Laibow-Koser
Jim Burgess wrote in post #967016: > Oh, right. Thanks a lot. That had been driving me mad (it's an exercise > in a book I'm reading). I changed the test method to: > > def test_should_display_airport_names_in_show > get :show, :id => flights(:dus_muc).id > assert_select 'p', "Departure airport

[Rails] Re: Use assert_select to test for the occurence of a string

2010-12-07 Thread Jim Burgess
Oh, right. Thanks a lot. That had been driving me mad (it's an exercise in a book I'm reading). I changed the test method to: def test_should_show_airport_names_in_show get :show, :id => flights(:dus_muc).id assert_select 'p', "Departure airport:\n DUS" end and it works perfectly. Thanks ag