From 5203f5c9834b065f74e65b4782709358216768bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Thu, 15 Oct 2015 17:05:34 +0200 Subject: [PATCH] adds specs for SOAP calls --- spec/lib/manager_authenticator_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/lib/manager_authenticator_spec.rb b/spec/lib/manager_authenticator_spec.rb index f9f09acce..256303fdd 100644 --- a/spec/lib/manager_authenticator_spec.rb +++ b/spec/lib/manager_authenticator_spec.rb @@ -43,6 +43,23 @@ describe ManagerAuthenticator do expect(@authenticator.auth).to be_truthy end + end + describe 'SOAP' do + before(:all) do + @authenticator = ManagerAuthenticator.new({login: "JJB033", clave_usuario: "31415926", fecha_conexion: "20151031135905"}) + end + + it 'should call the verification user method' do + allow(@authenticator).to receive(:application_authorized?).and_return(true) + expect(@authenticator.send(:client)).to receive(:call).with(:get_status_user_data, message: { ub: {user_key: "31415926", date: "20151031135905"} }) + @authenticator.auth + end + + it 'should call the permissions check method' do + allow(@authenticator).to receive(:manager_exists?).and_return(true) + expect(@authenticator.send(:client)).to receive(:call).with(:get_applications_user_list, message: { ub: {user_key: "31415926"} }) + @authenticator.auth + end end end \ No newline at end of file