spec/rosetta_auth_spec.rb in libis-services-1.0.10 vs spec/rosetta_auth_spec.rb in libis-services-1.0.11

- old
+ new

@@ -20,11 +20,11 @@ def invalid_protected_call(handler, producer_id) expect {handler.producer(producer_id)}.to raise_error(Libis::Services::ServiceError) end - let!(:credentials) {Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-test.yml')} + let!(:credentials) {Libis::Tools::ConfigFile.new File.join(File.dirname(__FILE__), 'credentials-prod.yml')} # noinspection RubyResolve let(:admin) {credentials.admin} # noinspection RubyResolve let(:admin_usr) {admin.user} @@ -32,10 +32,11 @@ let(:admin_uid) {admin.user_id} # noinspection RubyResolve let(:admin_pwd) {admin.password} # noinspection RubyResolve let(:admin_ins) {admin.institute} + let(:admin_pds_ins) {admin.institute_pds} let(:bad_cred) { 'deadbeaf' } describe 'basic authentication' do @@ -97,21 +98,21 @@ # noinspection RubyResolve Libis::Services::Rosetta::PdsHandler.new(credentials.pds_url) end describe 'with correct credentials' do - let(:handle) {pds_handler.login(admin_usr, admin_pwd, admin_ins)} + let(:handle) {pds_handler.login(admin_usr, admin_pwd, admin_pds_ins)} it 'should login and return a handle' do expect(handle).to_not be_nil end it 'should return patron info' do bor_info = pds_handler.user_info handle expect(bor_info[:bor_info][:id]).to eq admin_usr expect(bor_info[:bor_info][:name]).to eq admin_usr - expect(bor_info[:bor_info][:institute]).to eq admin_ins + expect(bor_info[:bor_info][:institute]).to eq admin_pds_ins end it 'should allow protected call' do handler.pds_handle = handle @@ -123,10 +124,10 @@ end end describe 'with wrong user name' do - let(:handle) {pds_handler.login(bad_cred, admin_pwd, admin_ins)} + let(:handle) {pds_handler.login(bad_cred, admin_pwd, admin_pds_ins)} it 'should not login' do expect(handle).to be_nil end \ No newline at end of file