mardi 25 octobre 2016

Capybara + Rspec

I make a web scanner tool. Basically, user enter an id (integer, for example 1) to input field, then click button Scan, an Ajax call to the backend to check if the item with the entered id is shippable or not. Let say that item is shippable. The Ajax will return the status "Item 1 shippable" which will be append to the view. I would like to write a test to make sure the page contains "Item 1 ship able". In the test, I create an Item (id = 1) status shippable, fill_in input field value 1, click_button Scan, within("div#status-container") expect page to have content "Item 1 shippable". But seem like Ajax call never happen. Any help?

Aucun commentaire:

Enregistrer un commentaire