view · edit · sidebar · attach · print · history

Index>

20161018-steinwies-test-rack

Summary

  • port sbsm/steinwies.ch to use the rack webserver and test it
  • Keep in Mind

Commits

Index

port sbsm/steinwies.ch to use the rack webserver and test it

Must rework tests like test/feature/kontakt_test.rb to use the test-rack. Started with makeing the following snippet pass

  def test_root
    get '/'
    assert last_response.ok?
    assert_match 'Fachpsychologin für Psychotherapie', last_response.body
  end

Using nokogiri to test page elements. Rewrote home_test.rb and dissertation_test.rb. Same for person and schwerpunkte. Now must test the only page which contains a POST element. The existing test does not contain any step to really test a submit.

The unit tests shows clearly, that the POST method does not work (it displays only the home page). Debugging the problem with pry.

Did sending E-Mail ever work for Steinwies? Yes. Handling the POST events fails in method test_user_input_hash of test/test_session.rb. I must fix this problem now. Fixed the unit tests in sbsm and applied some fixed in sbsm/lib to make them pass.

Now looking a steinwies.ch to analyse how the post works there. Using the HTTPFox I see that I get a POST for en/page with cookies sbsm-persistent-cookes language%3Den (it is flickering in my)

  email=ngiger%40ywesee.com&anrede=Herr&name=Giger&vorname=Niklaus&firma=&adresse=Wieshoschet+6&ort=8753+Mollis&telefon=&bestell_diss=&bestell_pedi=&confirm=Weiter&text=Test-Mail.+Bitte+ignorieren&flavor=&language=en&event=confirm&state_id=69945621979720

where on steinwies2.ngiger.ch I have no cookies, no query string and POST data {'email' => 'some@user', 'anrede', ''}. Its raw data look like

  email=ngiger%40ywesee.com&anrede=&name=&vorname=&firma=&adresse=&ort=&telefon=&bestell_diss=&bestell_pedi=&confirm=Weiter&text=++++++++++++++++++++++++ateaasdf&flavor=&language=en&event=confirm&state_id=69879328810640

Aftewards the en/page is loaded. But is an e-mail sent now?

The page for the confirm dialog displayed on steinwies.ch looks like this.

It looks as I am too stupid to understand how mod_ruby and sbsm interacted when handling a POST request. How can I figure this out? Should I try to use the pry with the master branch of steinwies.ch? Will continue tomorrow.

Pushed commit Made all unittests pass

Not yet pushing commits for steinwies.ch as I have problems cleaning up the thread after each test.

view · edit · sidebar · attach · print · history
Page last modified on October 18, 2016, at 07:06 PM