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
Post a Comment