view · edit · sidebar · attach · print · history






Convert to use SBSM 1.3.1 with rack

I will try to see what exactly was generated when using rack and not mod_ruby and whether the arguments were passed correctly between the javascript and rack. Looks like the session or app variable is not correctly saved between different RACK calls. Why? has an AjaxShop which gets initialized once and a Shop class, which get an init call each time after adding an item. Debugging the session[:cart_items] in my local sbsm copy.

I think I found the problem, as runing the tests by hand confirm, then the session-id is preserved. But when running the shop_test.rb the session-id gets lost each time. And my changes break 7 unit tests of sbsm, which I must look after.

No. I can see now the session_id in the test_shop by evaluating browser.cookies.to_a.find {|x| /persistent-sbsm/i.match(x[:name])}. The returned session_id stays the same after filling out the desired items and pressing tab.

Or do I have a completely different problem. Because in the rack output I see the following lines after pressing tab

wrong constant name EInvalidZone zone undefined
::1 - - [22/Nov/2016:11:48:52 +0100] "GET /en/undefined HTTP/1.1" 200 7083 0.0134

No. It is a difference between firefox (working) and chrome (not workin). Change shop_test.rb to use firefox instead of chromium. But this setup does not yet work correctly. After correcting some checks I see, that now the session_id changes, too. Therefore I must ask myself the question, whether I can test these pages with watir or not.

When manually testing the shop I remarked that if I load it directly via http://localhost:11090/en/communication/shop/ the total is not updated correctly when selecting several items. Wheres when going from the home via link, this works.

The unit-tests showed me clearly, that I had made a mistake when I merged the rack.POST parameters.

When supplying correct data for 1 item in the shopping cart and pressing enter, then I still get NameError wrong constant name EInvalidZone zone undefined, because somehow the key :zone is used. I do not understand whether this is a problem with the test cases or sbsm. This error is raised when we handle the GET request for /resources/dojo/dijit/popup.js. Therefore I conclude that in this case we do not pass all needed parameter to the javascript. Will analyse it tomorrow.

Pushed commit Better handling of POST requests and Reworking unit test. Debug-Info for cart_items

view · edit · sidebar · attach · print · history
Page last modified on November 22, 2016, at 05:55 PM