Capybara with javascript and factory girl -


i have 1 factory inheritance

factorygirl.define  factory :client    sequence(:first_name) { |n| "john#{n}" }    sequence(:last_name)  { |n| "smith#{n}" }  factory : client_with_dialog    show_popup true  end 

on react code getting server client show popup value.

$.get('/client/get_choise') .done(function (result) {   if (result.show_popup) {     alert();   } }); 

test code:

scenario 'visit page popup'   client =  create :client_with_dialog    visit_page_with_popup end 

on capybara testing popup not showing, question $.get('/client/get_choise') code run in tests or not? how can write capybara test open popup window?

it sounds you're using rack-test driver doesn't support javascript. start here https://github.com/jnicklas/capybara#selecting-the-driver


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -