S Ahmed
2012-Mar-02 03:33 UTC
[rspec-users] can I output the html of the page after calling click_button?
I am not sure why my form submission is failing (request test). I am calling: # form is filled in a ''before do'' block. it "should create an account" do expect { click_button "Create" }.to change(Account, :count).by(1) end Could I somehow view the HTML after the click_button call? Manually submitting the form works fine for me, so I''m confused. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120301/44df4ad0/attachment-0001.html>
Andrew Premdas
2012-Mar-02 11:23 UTC
[rspec-users] can I output the html of the page after calling click_button?
see below On 2 March 2012 03:33, S Ahmed <sahmed1020 at gmail.com> wrote:> I am not sure why my form submission is failing (request test). > > I am calling: > > # form is filled in a ''before do'' block. > > it "should create an account" do > expect { click_button "Create" }.to change(Account, :count).by(1) >put a debugger statement here debugger 1 # so the debugger doesn''t drop into rspec end> > Could I somehow view the HTML after the click_button call? > > Manually submitting the form works fine for me, so I''m confused. > >Now you can 1) Look at the html directly e.g. > page.body 2) Output the page.body in a pretty way perhaps using Coderay 3) Use irb to do all sorts of other thing Alternatively use capybara'' save_and_open_page HTH Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120302/23e94b78/attachment.html>