On Mon, May 13, 2013 at 11:23 PM, tamouse mailing lists <tamouse.li...@gmail.com> wrote: > https://github.com/assafshomer/clear_button/pull/1 > > On Mon, May 13, 2013 at 11:20 PM, tamouse mailing lists > <tamouse.li...@gmail.com> wrote: >> let me push my change up and do a PR and see if you can see a diff: it >> works for me. >> >> On Mon, May 13, 2013 at 12:28 AM, Assaf Shomer <li...@ruby-forum.com> wrote: >>> tamouse mailing lists wrote in post #1108719: >>>> On Sun, May 12, 2013 at 4:46 PM, Assaf Shomer <li...@ruby-forum.com> >>>> wrote: >>>>>> >>>>>> Just a quick glance, but you probably should move lines 10-16 (the >>>>>> before and it blocks) inside their own describe block, as the before >>>>>> block at line 10 is also running before every it in the other describe >>>>>> blocks. >>>>> >>>>> Thanks. Moved test inside a describe block. >>>>> Problem still remains though. >>>> >>>> Both the before at line 10 through the end of the it test at line 16 >>>> need to be in their own describe block, not just the test. >>> >>> I think this is what I did in the last push, isn't it? >>> >>> Before: >>> >>> ------------------------------------------------------- >>> require 'spec_helper' >>> >>> describe "Pages" do >>> subject { page } >>> before { visit '/pages/input'} >>> describe "search" do >>> it { should have_selector('input#show_button') } >>> it { should have_selector('input#clear_button') } >>> end >>> before do >>> fill_in 'input_field', with: 'blah' >>> click_button 'Show' >>> end >>> it "should display the string 'blah'" do >>> page.should have_selector('h3', text: 'blah') >>> end >>> describe 'clear button' do >>> before { click_button 'Clear' } >>> it "should not show the string 'blah'" do >>> page.should_not have_selector('h3', text: 'blah') >>> end >>> end >>> end >>> ----------------------------------------------------- >>> >>> now: >>> >>> ----------------------------------------------------- >>> >>> require 'spec_helper' >>> >>> describe "Pages" do >>> subject { page } >>> before { visit '/pages/input'} >>> describe "input form" do >>> it { should have_selector('input#show_button') } >>> it { should have_selector('input#clear_button') } >>> end >>> describe "show button" do >>> before do >>> fill_in 'input_field', with: 'blah' >>> click_button 'Show' >>> end >>> it "should display the string 'blah'" do >>> page.should have_selector('h3', text: 'blah') >>> end >>> end >>> describe 'clear button' do >>> before do >>> fill_in 'input_field', with: 'blah' >>> click_button 'Show' >>> click_button 'Clear' >>> end >>> it "should not show the string 'blah'" do >>> page.should_not have_selector('h3', text: 'blah') >>> end >>> end >>> end >>> >>> ----------------------------------------------------- >>> >>> Bottom line, test still fails. >>> >>> any other suggestions?
Okay, as near as I can figure out, capybara is choking on the fact that you have commit=Show in your query string, you're using method=GET in your form, and commit=Clear is coming in the request body. Somehow, when rails is called by the browser, this is handled in the way you want (which is the request body's commit=Clear overrides the one in the query string), but in capybara, it isn't. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.