ruby on rails 3 - javascript void links with RSpec -


my rails app uses nav pills change partial used on form.

%ul.nav.nav-pills    %li.active       %a{href: "javascript:void()", id: 'post_one_partial', name: 'post_one_tab'} post 1     %li       %a{href: "javascript:void()", id: 'post_many_partial', name: 'post_many_tab'} post many 

these work in development mode, using coffeescript.

$(document).on 'click', '#post_one_partial, #post_many_partial', ->   post_id = $(this).attr('id')   $('#'+post_id).parent().addclass('active').siblings().removeclass('active')   if post_id == 'post_one_partial'     $('#many_form').hide()     $('#form').show()   else     $('#form').hide()     $('#many_form').show()   false 

the goal here keep 2 ways of creating records contained within single create action, rather splitting up. when click on nav pills in development, well, attempting simulate process in testing rspec doesn't. progresses through commands, "clicks" button (or believe, because javascript:void() appears in bottom left corner of browser window), nothing happens. there no changes made form @ all. there setting of sort i'm missing?

feature spec

scenario "user posts many trucks", js: true   resquespec.reset!    visit "/trucks/new"   click_on "post_many_partial"   page.should have_content "enter number of trucks post."   fill_in "post_many_trucks", with: 3   click_on "submit"   # further code tests after form updated end 

this spec failing when clicking post_many_partial. when link "is clicked", see javascript:void() on screen, form doesn't update. point, test fails because post_many_trucks doesn't exist on page yet.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -