view · edit · sidebar · attach · print · history






Convert to use SBSM 1.3.1 with rack

Must solve the following problems:

  • Fix displaying animated gif
  • Fix test for sending an e-mail in shop
  • Fix displaying pager items in shop
  • Fix running on travis-ci

Configured SBSM::Logging for unit test early via SBSM.logger= in test/support/test_case.rb. The YUS-Server is no longer properly initialized when running unit tests. Why? Must introduce a config variable yus_server for the test. Now the test work locally, but does not stop correctly the davaz-app and rack server. Fixed this problem with commits Fix yus-server when running tests and Use mail gem

Now working on the unit test for shopping where we deliver an e-mail. Found out that the sum is not updated correctly in when using the stub/db_manager.

Also remarked that the validator does accept articles (which is a hash) as user_input, whereas other fields like e-mail, name, were processed correctly. Somehow we don't handle hashes correctly. After merging the rack.request.form_hash into the hash for import_user_input my new unit test passed. But this did not fix the real problem.

Digging deeper I see that I did not handle the post parameter correctly. I must consider the Rack::Request env parameter 'rack.request.form_vars', too. They can be found via rack_req.POST, too. But must fix first the problem, that the total of order is not updated after entering a number and pressing TAB. This should result in a HTTP get for GET /en/communication/ajax_shop/artobject_id/1616/count/2

This get request gets stuck with an error, which is not displayed, but which can be in the console output

Checking count -> 2  valid "2" index nil
NoMethodError: private method `select' called for nil:NilClass
        /var/www/ `init'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:381:in `process'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:175:in `block in drb_process'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:174:in `synchronize'
        /home/niklaus/git/sbsm/lib/sbsm/session.rb:174:in `drb_process'
        /usr/local/lib/ruby/2.3.0/drb/drb.rb:1137:in `method_missing'
        /home/niklaus/git/sbsm/lib/sbsm/app.rb:105:in `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `_call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `call'
        /var/www/ `service'
        /usr/local/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
        /usr/local/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'

Also remarked that US$ and Euro-Prices for each items are all 0. Problem is that the cookie :remember via persistent_user_input is not set correctly.

Saved html output from after selecting one, then two shopping items. Difference for

  • GET /en/communication/ajax_shop/artobject_id/1048/count/2 to
  • GET /en/communication/ajax_shop/artobject_id/1046/count/2 is
<td class="shopping-cart-title">Drawings</td>
<td>CHF 100.-</td>
<td class="shopping-cart-subtotal">CHF 200.-</td>
<td><a name="remove_item" href="javascript:void(0)" onclick="removeFromShoppingCart('', 'article[1046]');
">Remove item</a></td>

Tomorrow I will try to see what exactly was generated when using rack and not mod_ruby.

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