From 81bf56e4589b842a32446fa5a5cf6fd1823d3b20 Mon Sep 17 00:00:00 2001 From: Isaac Lewis Date: Mon, 14 May 2018 13:18:37 -0700 Subject: [PATCH] logon error handling --- lib/syspro/logon.rb | 2 +- test/cassettes/test_client_block_execution.yml | 6 +++--- test/cassettes/test_get_syspro_version.yml | 6 +++--- test/cassettes/test_logoff_error.yml | 6 +++--- test/cassettes/test_logon.yml | 8 ++++---- test/cassettes/test_logon_error.yml | 36 ++++++++++++++++++++++++++++++++++++ test/cassettes/test_query_browse.yml | 16 ++++++++-------- test/cassettes/test_query_fetch.yml | 16 ++++++++-------- test/cassettes/test_query_query.yml | 16 ++++++++-------- test/cassettes/test_sor_query.yml | 12 ++++++------ test/cassettes/test_successful_logoff.yml | 16 ++++++++-------- test/logon_test.rb | 11 +++++++++++ 12 files changed, 99 insertions(+), 52 deletions(-) create mode 100644 test/cassettes/test_logon_error.yml diff --git a/lib/syspro/logon.rb b/lib/syspro/logon.rb index 2fddf00..6d4a735 100644 --- a/lib/syspro/logon.rb +++ b/lib/syspro/logon.rb @@ -18,7 +18,7 @@ module Syspro '/Logon' end - def handle_errors(resp) + def self.handle_errors(resp) body = resp[0].http_body raise AuthenticationError, body if body =~ /^(ERROR)/ end diff --git a/test/cassettes/test_client_block_execution.yml b/test/cassettes/test_client_block_execution.yml index b3bb1e5..963dbba 100644 --- a/test/cassettes/test_client_block_execution.yml +++ b/test/cassettes/test_client_block_execution.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,10 +27,10 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:43 GMT + - Mon, 14 May 2018 20:17:40 GMT body: encoding: UTF-8 string: 7.0.0.6 http_version: - recorded_at: Fri, 06 Apr 2018 19:23:42 GMT + recorded_at: Mon, 14 May 2018 20:17:40 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_get_syspro_version.yml b/test/cassettes/test_get_syspro_version.yml index b3bb1e5..963dbba 100644 --- a/test/cassettes/test_get_syspro_version.yml +++ b/test/cassettes/test_get_syspro_version.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,10 +27,10 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:43 GMT + - Mon, 14 May 2018 20:17:40 GMT body: encoding: UTF-8 string: 7.0.0.6 http_version: - recorded_at: Fri, 06 Apr 2018 19:23:42 GMT + recorded_at: Mon, 14 May 2018 20:17:40 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_logoff_error.yml b/test/cassettes/test_logoff_error.yml index 84e28f5..3394f37 100644 --- a/test/cassettes/test_logoff_error.yml +++ b/test/cassettes/test_logoff_error.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,10 +27,10 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:22:53 GMT + - Mon, 14 May 2018 20:17:51 GMT body: encoding: UTF-8 string: 'ERROR: Unable to read the SYSPRO base directory registry string BaseDir8' http_version: - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT + recorded_at: Mon, 14 May 2018 20:17:50 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_logon.yml b/test/cassettes/test_logon.yml index 96606f2..64c8ba6 100644 --- a/test/cassettes/test_logon.yml +++ b/test/cassettes/test_logon.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,10 +27,10 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:52 GMT + - Mon, 14 May 2018 20:17:49 GMT body: encoding: UTF-8 - string: 'EC3098D6E284FB44ADF10671B3F06FCA00 ' + string: 'DC3EC6C004B7FF4B8BF56FF221315DAA00 ' http_version: - recorded_at: Fri, 06 Apr 2018 19:23:51 GMT + recorded_at: Mon, 14 May 2018 20:17:48 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_logon_error.yml b/test/cassettes/test_logon_error.yml new file mode 100644 index 0000000..fe6764c --- /dev/null +++ b/test/cassettes/test_logon_error.yml @@ -0,0 +1,36 @@ +--- +http_interactions: +- request: + method: get + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logon?CompanyId=L&CompanyPassword=&Operator=wland&OperatorPassword=bad_password + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Syspro/7 RubyBindings/1.0.0.alpha.1 + Content-Type: + - application/x-www-form-urlencoded + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Content-Length: + - '32' + Content-Type: + - application/octet-stream + Server: + - Microsoft-HTTPAPI/2.0 + Date: + - Mon, 14 May 2018 20:17:51 GMT + body: + encoding: UTF-8 + string: 'ERROR: Invalid operator password' + http_version: + recorded_at: Mon, 14 May 2018 20:17:50 GMT +recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_query_browse.yml b/test/cassettes/test_query_browse.yml index fe5281d..51feea7 100644 --- a/test/cassettes/test_query_browse.yml +++ b/test/cassettes/test_query_browse.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,21 +27,21 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:03 GMT + - Mon, 14 May 2018 20:17:02 GMT body: encoding: UTF-8 - string: '64C41E1DEB73024CA660211DE643705700 ' + string: 'B417B48864C0814DA59D1F349AEC8D8A00 ' http_version: - recorded_at: Fri, 06 Apr 2018 19:23:01 GMT + recorded_at: Mon, 14 May 2018 20:17:01 GMT - request: method: get - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Browse?UserId=64C41E1DEB73024CA660211DE643705700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CBrowse%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMBRW.XSD%22%3E%0A%20%20%3CBrowseName%3EInvMaster%3C/BrowseName%3E%0A%20%20%3CStartAtKey/%3E%0A%20%20%3CStartCondition%3E%3C/StartCondition%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%0A%20%20%3CBrowseDetails%3E%0A%20%20%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%20%20%3CTitle%3EStockCodes%3C/Title%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3E%0A%20%20%20%20%20%20%20%20%3CColumnName%3EStockCode%3C/ColumnName%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/BrowseDetails%3E%0A%3C/Browse%3E%0A%0A + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Browse?UserId=B417B48864C0814DA59D1F349AEC8D8A00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CBrowse%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMBRW.XSD%22%3E%0A%20%20%3CBrowseName%3EInvMaster%3C/BrowseName%3E%0A%20%20%3CStartAtKey/%3E%0A%20%20%3CStartCondition%3E%3C/StartCondition%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%0A%20%20%3CBrowseDetails%3E%0A%20%20%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%20%20%3CTitle%3EStockCodes%3C/Title%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3E%0A%20%20%20%20%20%20%20%20%3CColumnName%3EStockCode%3C/ColumnName%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/BrowseDetails%3E%0A%3C/Browse%3E%0A%0A body: encoding: US-ASCII string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -60,7 +60,7 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:07 GMT + - Mon, 14 May 2018 20:17:06 GMT body: encoding: UTF-8 string: "\n\nStockCodes\n\n\n02\nAlphaNumeric\n\n\n\n\n021\nAlphaNumeric\n\n\n\n\n0214011IFF\nAlphaNumeric\n\n\n\n\n022\nAlphaNumeric\n\n\n\n\n023\nAlphaNumeric\n\n\n\n02\n023\nTrue\nFalse\n\n\n
Stock code
\nStockCode\nStock code\nInvMaster
\n
\n
\n " http_version: - recorded_at: Fri, 06 Apr 2018 19:23:06 GMT + recorded_at: Mon, 14 May 2018 20:17:05 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_query_fetch.yml b/test/cassettes/test_query_fetch.yml index c335574..840d7cc 100644 --- a/test/cassettes/test_query_fetch.yml +++ b/test/cassettes/test_query_fetch.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,21 +27,21 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:16 GMT + - Mon, 14 May 2018 20:17:15 GMT body: encoding: UTF-8 - string: '5B21680F424424498B7CE7CCDA98B41700 ' + string: '9A5B2797B021A04DA9E933CBCF3CB59700 ' http_version: - recorded_at: Fri, 06 Apr 2018 19:23:15 GMT + recorded_at: Mon, 14 May 2018 20:17:14 GMT - request: method: get - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Fetch?UserId=5B21680F424424498B7CE7CCDA98B41700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CFetch%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFCH.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CKey%3E02%3C/Key%3E%0A%20%20%0A%20%20%3CFullKeyProvided%3EY%3C/FullKeyProvided%3E%0A%20%20%3CDefaultType%3E%3C/DefaultType%3E%0A%20%20%3CEspressoFetch%3EN%3C/EspressoFetch%3E%0A%3C/Fetch%3E%0A%0A + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Fetch?UserId=9A5B2797B021A04DA9E933CBCF3CB59700%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CFetch%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFCH.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CKey%3E02%3C/Key%3E%0A%20%20%0A%20%20%3CFullKeyProvided%3EY%3C/FullKeyProvided%3E%0A%20%20%3CDefaultType%3E%3C/DefaultType%3E%0A%20%20%3CEspressoFetch%3EN%3C/EspressoFetch%3E%0A%3C/Fetch%3E%0A%0A body: encoding: US-ASCII string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -60,7 +60,7 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:26 GMT + - Mon, 14 May 2018 20:17:23 GMT body: encoding: UTF-8 string: "\n\n\n\n\n\n \ 0\n 0\n\n\n\n\n\n " http_version: - recorded_at: Fri, 06 Apr 2018 19:23:24 GMT + recorded_at: Mon, 14 May 2018 20:17:22 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_query_query.yml b/test/cassettes/test_query_query.yml index 1d6af87..6639629 100644 --- a/test/cassettes/test_query_query.yml +++ b/test/cassettes/test_query_query.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,21 +27,21 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:35 GMT + - Mon, 14 May 2018 20:17:32 GMT body: encoding: UTF-8 - string: '5810EEA000F1F04BA915BAF98CA700EE00 ' + string: '34C603B5A0981D40BCB1B2E4111B1A5900 ' http_version: - recorded_at: Fri, 06 Apr 2018 19:23:33 GMT + recorded_at: Mon, 14 May 2018 20:17:31 GMT - request: method: get - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=COMFND&UserId=5810EEA000F1F04BA915BAF98CA700EE00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFND.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%3CColumns%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/Columns%3E%0A%20%20%0A%20%20%20%20%3CWhere%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3CExpression%3E%0A%20%20%20%20%20%20%20%20%20%20%3COpenBracket%3E(%3C/OpenBracket%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAndOr%3EAnd%3C/AndOr%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCondition%3EEQ%3C/Condition%3E%0A%20%20%20%20%20%20%20%20%20%20%3CValue%3E02%3C/Value%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCloseBracket%3E)%3C/CloseBracket%3E%0A%20%20%20%20%20%20%20%20%3C/Expression%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%3C/Where%3E%0A%20%20%0A%20%20%3COrderBy%3E%0A%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%3C/OrderBy%3E%0A%3C/Query%3E%0A + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=COMFND&UserId=34C603B5A0981D40BCB1B2E4111B1A5900%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22COMFND.XSD%22%3E%0A%20%20%3CTableName%3EInvMaster%3C/TableName%3E%0A%20%20%3CReturnRows%3E5%3C/ReturnRows%3E%0A%20%20%3CColumns%3E%0A%20%20%20%20%0A%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%0A%20%20%3C/Columns%3E%0A%20%20%0A%20%20%20%20%3CWhere%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3CExpression%3E%0A%20%20%20%20%20%20%20%20%20%20%3COpenBracket%3E(%3C/OpenBracket%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CAndOr%3EAnd%3C/AndOr%3E%0A%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCondition%3EEQ%3C/Condition%3E%0A%20%20%20%20%20%20%20%20%20%20%3CValue%3E02%3C/Value%3E%0A%20%20%20%20%20%20%20%20%20%20%3CCloseBracket%3E)%3C/CloseBracket%3E%0A%20%20%20%20%20%20%20%20%3C/Expression%3E%0A%20%20%20%20%20%20%0A%20%20%20%20%3C/Where%3E%0A%20%20%0A%20%20%3COrderBy%3E%0A%20%20%20%20%3CColumn%3EStockCode%3C/Column%3E%0A%20%20%3C/OrderBy%3E%0A%3C/Query%3E%0A body: encoding: US-ASCII string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -60,7 +60,7 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:23:43 GMT + - Mon, 14 May 2018 20:17:40 GMT body: encoding: UTF-8 string: "\n\n\nInvMaster\n\nStockCode\n\n\nStockCode\n\n\n\n02\n\n \ 1\n\n " http_version: - recorded_at: Fri, 06 Apr 2018 19:23:41 GMT + recorded_at: Mon, 14 May 2018 20:17:39 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_sor_query.yml b/test/cassettes/test_sor_query.yml index 3a2482f..4d735a4 100644 --- a/test/cassettes/test_sor_query.yml +++ b/test/cassettes/test_sor_query.yml @@ -27,15 +27,15 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Thu, 26 Apr 2018 19:08:08 GMT + - Mon, 14 May 2018 20:16:48 GMT body: encoding: UTF-8 - string: 'E3333B82C68A4F4893184E2DE8C42E4A00 ' + string: 'C525B53B5C1C0F4DA6A5DE07E7FE1D0000 ' http_version: - recorded_at: Thu, 26 Apr 2018 19:08:09 GMT + recorded_at: Mon, 14 May 2018 20:16:48 GMT - request: method: get - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=SORQRY&UserId=E3333B82C68A4F4893184E2DE8C42E4A00%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22SORQRY.XSD%22%3E%0A%20%20%3CKey%3E%0A%20%20%20%20%3CSalesOrder%3E16R069%3C/SalesOrder%3E%0A%20%20%20%20%0A%20%20%3C/Key%3E%0A%20%20%3COption%3E%0A%20%20%20%20%3CIncludeStockedLines%3EN%3C/IncludeStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeNonStockedLines%3EN%3C/IncludeNonStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeFreightLines%3EN%3C/IncludeFreightLines%3E%0A%20%20%20%20%20%20%3CIncludeMiscLines%3EN%3C/IncludeMiscLines%3E%0A%20%20%20%20%20%20%3CIncludeCommentLines%3EN%3C/IncludeCommentLines%3E%0A%20%20%20%20%20%20%3CIncludeCompletedLines%3EN%3C/IncludeCompletedLines%3E%0A%20%20%20%20%20%20%3CIncludeSerials%3EN%3C/IncludeSerials%3E%0A%20%20%20%20%20%20%3CIncludeLots%3EN%3C/IncludeLots%3E%0A%20%20%20%20%20%20%3CIncludeBins%3EN%3C/IncludeBins%3E%0A%20%20%20%20%20%20%3CIncludeAttachedItems%3EN%3C/IncludeAttachedItems%3E%0A%20%20%20%20%20%20%3CIncludeCustomForms%3EN%3C/IncludeCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeDetailLineCustomForms%3EN%3C/IncludeDetailLineCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeValues%3EN%3C/IncludeValues%3E%0A%20%20%20%20%20%20%3CReturnLineShipDate%3EN%3C/ReturnLineShipDate%3E%0A%20%20%20%20%20%20%3CXslStylesheet/%3E%0A%20%20%3C/Option%3E%0A%3C/Query%3E%0A%0A + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/Query/Query?BusinessObject=SORQRY&UserId=C525B53B5C1C0F4DA6A5DE07E7FE1D0000%20%20&XmlIn=%3C?xml%20version=%221.0%22%20encoding=%22Windows-1252%22?%3E%0A%3CQuery%20xmlns:xsd=%22http://www.w3.org/2001/XMLSchema-instance%22%20xsd:noNamespaceSchemaLocation=%22SORQRY.XSD%22%3E%0A%20%20%3CKey%3E%0A%20%20%20%20%3CSalesOrder%3E16R069%3C/SalesOrder%3E%0A%20%20%20%20%0A%20%20%3C/Key%3E%0A%20%20%3COption%3E%0A%20%20%20%20%3CIncludeStockedLines%3EN%3C/IncludeStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeNonStockedLines%3EN%3C/IncludeNonStockedLines%3E%0A%20%20%20%20%20%20%3CIncludeFreightLines%3EN%3C/IncludeFreightLines%3E%0A%20%20%20%20%20%20%3CIncludeMiscLines%3EN%3C/IncludeMiscLines%3E%0A%20%20%20%20%20%20%3CIncludeCommentLines%3EN%3C/IncludeCommentLines%3E%0A%20%20%20%20%20%20%3CIncludeCompletedLines%3EN%3C/IncludeCompletedLines%3E%0A%20%20%20%20%20%20%3CIncludeSerials%3EN%3C/IncludeSerials%3E%0A%20%20%20%20%20%20%3CIncludeLots%3EN%3C/IncludeLots%3E%0A%20%20%20%20%20%20%3CIncludeBins%3EN%3C/IncludeBins%3E%0A%20%20%20%20%20%20%3CIncludeAttachedItems%3EN%3C/IncludeAttachedItems%3E%0A%20%20%20%20%20%20%3CIncludeCustomForms%3EN%3C/IncludeCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeDetailLineCustomForms%3EN%3C/IncludeDetailLineCustomForms%3E%0A%20%20%20%20%20%20%3CIncludeValues%3EN%3C/IncludeValues%3E%0A%20%20%20%20%20%20%3CReturnLineShipDate%3EN%3C/ReturnLineShipDate%3E%0A%20%20%20%20%20%20%3CXslStylesheet/%3E%0A%20%20%3C/Option%3E%0A%3C/Query%3E%0A%0A body: encoding: US-ASCII string: '' @@ -60,7 +60,7 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Thu, 26 Apr 2018 19:08:15 GMT + - Mon, 14 May 2018 20:16:53 GMT body: encoding: UTF-8 string: "\n\n 0.000000\nN\n\nN\n \ 1.000000\n1.000000\nM\n\nI\n\n\n\n\n\n\n\n000\n00\n0\n\n\n\n\n\n\n\nMATTB\n\n\n\n\n\n\n\n\n0\nY\n\n\n\n\n\n " http_version: - recorded_at: Thu, 26 Apr 2018 19:08:15 GMT + recorded_at: Mon, 14 May 2018 20:16:52 GMT recorded_with: VCR 4.0.0 diff --git a/test/cassettes/test_successful_logoff.yml b/test/cassettes/test_successful_logoff.yml index 8ff8c38..9ee8340 100644 --- a/test/cassettes/test_successful_logoff.yml +++ b/test/cassettes/test_successful_logoff.yml @@ -8,7 +8,7 @@ http_interactions: string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -27,21 +27,21 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:22:53 GMT + - Mon, 14 May 2018 20:17:59 GMT body: encoding: UTF-8 - string: '989D81EB0B184A499E7AC2E28724EE9000 ' + string: '305EC4843488A34FA16A50494B42BA7C00 ' http_version: - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT + recorded_at: Mon, 14 May 2018 20:17:58 GMT - request: method: get - uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logoff?UserId=989D81EB0B184A499E7AC2E28724EE9000%20%20 + uri: http://syspro.wildlandlabs.com:90/SYSPROWCFService/Rest/logoff?UserId=305EC4843488A34FA16A50494B42BA7C00%20%20 body: encoding: US-ASCII string: '' headers: User-Agent: - - Syspro/7 RubyBindings/0.1.0 + - Syspro/7 RubyBindings/1.0.0.alpha.1 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -60,10 +60,10 @@ http_interactions: Server: - Microsoft-HTTPAPI/2.0 Date: - - Fri, 06 Apr 2018 19:22:53 GMT + - Mon, 14 May 2018 20:17:59 GMT body: encoding: UTF-8 string: '0' http_version: - recorded_at: Fri, 06 Apr 2018 19:22:52 GMT + recorded_at: Mon, 14 May 2018 20:17:59 GMT recorded_with: VCR 4.0.0 diff --git a/test/logon_test.rb b/test/logon_test.rb index 73c5345..177f750 100644 --- a/test/logon_test.rb +++ b/test/logon_test.rb @@ -23,4 +23,15 @@ class LogonTest < Minitest::Test ).guid ) end + + def test_logon_error + assert_raises(::Syspro::AuthenticationError) { + logon_result = ::Syspro::SysproClient.new.logon( + username, + 'bad_password', + company, + company_password + ) + } + end end -- libgit2 0.21.4