fix: make sms library send the messages and accept correct message format
This fixes the library and make it send sms correctly:
- fix the configuration which can now accept the correct hash of options
- sendSms function accepts what need to be send
- add some initial validation for the message format
- fix all the tests
all tests passing as well:
$ rake spec
/usr/local/bin/ruby -I/usr/local/bundle/gems/rspec-support-3.9.3/lib:/usr/local/bundle/gems/rspec-core-3.9.2/lib /usr/local/bundle/gems/rspec-core-3.9.2/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
Wedoops::MasmovilSmsclient
Trying to config
has a version number
Configuration
The configuration shuld be a MasmovilSmsclient::Configuration
The option is a Hash
The proxy can be set
SOAP Client
D, [2020-10-03T09:56:00.997831 #19421] DEBUG -- : Initlizing savon
Can load
D, [2020-10-03T09:56:00.998181 #19421] DEBUG -- : Initlizing savon
Cannot send an empty message
D, [2020-10-03T09:56:00.999640 #19421] DEBUG -- : Initlizing savon
I, [2020-10-03T09:56:00.999962 #19421] INFO -- : Sending the message: {:src=>"TESTER", :dst=>"+34619766776", :msg=>"This is the tester text 2020-10-03T09:56:00+00:00", :name=>"Testing", :date=>"2020-10-03 10:01:00Z"}
/usr/local/bundle/gems/wasabi-3.5.0/lib/wasabi/parser.rb:89: warning: URI.unescape is obsolete
/usr/local/bundle/gems/wasabi-3.5.0/lib/wasabi/parser.rb:90: warning: URI.escape is obsolete
I, [2020-10-03T09:56:01.354364 #19421] INFO -- : SOAP request: https://websms.xtratelecom.es/api_php/server.php
I, [2020-10-03T09:56:01.354519 #19421] INFO -- : SOAPAction: "urn:websms.xtratelecom.es/api_php/server.php/sendSMS", Content-Type: text/xml;charset=UTF-8, Content-Length: 530
I, [2020-10-03T09:56:01.721959 #19421] INFO -- : SOAP response (status 200)
Can send a correct message
Finished in 0.72826 seconds (files took 0.48723 seconds to load)
7 examples, 0 failures
/cc @chantal