ruby on rails - Capybara Element not found -
i wondering if explain me why getting error when element can seen on test page. writing test allow entries archived. @ point acting more separate saving mechanism clean show page or @ least allow be. test follows.
"can archive diagnostic report" diagnostic_info = fg.create(:diagnostic_info) diagnostic_info.save! visit admin_diagnostics_path page.should have_content("test message") click_button "save" end
the view
= form_for [:admin, @diagnostic], url: admin_diagnostic_path |f| .field = link_to :raw_json, admin_diagnostic_path(@diagnostic, format: :json) .field = label_tag :device = label_tag %pre= json.pretty_generate(@diagnostic.data["device"]) .field = label_tag :localstorage = simple_format(@diagnostic.notes) -if @diagnostic.data["localstorage"] = label_tag %pre= json.pretty_generate(@diagnostic.data["localstorage"]) = submit_tag 'save', method: :put, data: { confirm: "are sure?" } = link_to 'delete', admin_diagnostic_path(@diagnostic), method: :delete, data: { confirm: 'really?' } = link_to 'edit', edit_admin_diagnostic_path
my error below-it passing ok before added click button save part
1) /admin/diagnostics can archive diagnostic report failure/error: click_button "save" capybara::elementnotfound: unable find button "save" # ./spec/features/admin/diagnostics_spec.rb:28:in `block (2 levels) in <top (required)>'
Comments
Post a Comment