I do not get farther than the login dialog. But via https://ydim.oddb-ci2.dyndns.org/de I don't get a list of the customer. Why? For the moment just patched lib/ydim/html/state/init.rb to return always true on login.
In the ydim-html (ruby 2.3.0) process I added the following debug statements for the _to_html method in lib/htmlgrid/component.rb
if @value.is_a?(String) && /ller/i.match(@value) $stderr.puts "to_html1 #{@value.inspect} > 1.9? #{RUBY_VERSION > "1.9"}" $stderr.puts "to_html2 #{@value.encoding}" if @value && @value.respond_to?(:encoding) $stderr.puts "to_html3 #{ _to_html(context, @value).to_s.force_encoding('utf-8').inspect}" end
and got
to_html1 "Müller" > 1.9? true to_html2 UTF-8 to_html3 "Müller"
but the HTML output is still
It looks to me that mod_ruby for 1.9.1 has problems accepting the UTF-8 encoded output returned from ydim-html (Ruby 2.3.0).
Trying again to make test spec tests with watir run. Finally the watir test starts up and I am able to run my fist test, and check that I can login.
See
I am having Umlaut problems, too. Looking into the source of the HTML document I see next_invoice_date">Nächste Rechnung</A>
and ACCEPT-CHARSET="UTF-8" ENCTYPE="application/x-www-form-urlencoded">
. Whereas I YDIM::Html::Custom::Lookandfeel::DICTIONARIES['de'] [:th_next_invoice_date] returns (via pry) "Nächste Rechnung"
and its encoding is Encoding:UTF-8.
Found the way to debug errors by setting @http_server.logger.level = WEBrick::BasicLog::DEBUG
for the YDIM::Html::Stub.http_server(drb_url)
. Now I can debug, why the login spec test did run only once.
Removed manually the htmlgrid/ext/htmlgrid/*o files or I would get an error when running with Ruby 2.3.0. Now I see always a warning could not find htmlgrid.so, falling back to pure-ruby class
, which is fine for the moment for me.
Pushed commit First watir spec test passes, as I am unable to finish creating a spec test for creating successfully an invoice.
Running locally with the following to lines in Gemfile to be able to easily debug sbsm/htmlgrid, too.
gem "sbsm", :path => '/home/niklaus/git/sbsm' gem "htmlgrid", :path => '/home/niklaus/git/htmlgrid'
When I try to run two tests I get errors like
[2016-04-27 17:35:26] DEBUG WEBrick::HTTPServlet::ProcHandler is invoked. From: /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/cgi/core.rb @ line 663 CGI::QueryExtension#initialize_query: 658: env_table['QUERY_STRING'] or "" 659: end 660: when "POST" 661: stdinput.binmode if defined? stdinput.binmode 662: binding.pry unless env_table['CONTENT_LENGTH'] => 663: stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or '' 664: else 665: read_from_cmdline 666: end.dup.force_encoding(@accept_charset) 667: ) 668: unless Encoding.find(@accept_charset) == Encoding::ASCII_8BIT [1] pry(#<CGI>)> continue [2016-04-27 17:35:32] ERROR TypeError: can't convert nil into Integer /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/cgi/core.rb:663:in `Integer' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/cgi/core.rb:663:in `initialize_query' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/cgi/core.rb:853:in `initialize' /opt/src/sbsm/lib/sbsm/request.rb:41:in `new' /opt/src/sbsm/lib/sbsm/request.rb:41:in `initialize' /opt/src/ydim-html/spec/stub/http_server.rb:59:in `new' /opt/src/ydim-html/spec/stub/http_server.rb:59:in `block in http_server' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/webrick/httpservlet/prochandler.rb:39:in `do_GET' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/webrick/httpservlet/abstract.rb:107:in `service' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run' /home/niklaus/.rbenv/versions/2.3.0/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'Which is displayed as "Internal Server Error: can't convert nil into Integer".
TODO for next week:
It looks like we are missing in ydim-html code the line ACCEPT_CHARSET = 'UTF-8'
found in src/view/form.rb