Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee7bb47
commit eb2e3ce
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'spec_helper' | ||
|
||
describe NetSuite::Actions::Login do | ||
it 'properly executes a login call' do | ||
savon.mock! | ||
|
||
message = {"platformMsgs:passport"=>{"platformCore:email"=>"email", "platformCore:password"=>"password", "platformCore:account"=>"1234", "platformCore:role"=>234}} | ||
|
||
savon.expects(:login).with(:message => message).returns(File.read('spec/support/fixtures/login.xml')) | ||
|
||
result = NetSuite::Actions::Login.call({ | ||
email: 'email', | ||
password: 'password', | ||
role: 234 | ||
}) | ||
|
||
expect(result.success?).to eq(true) | ||
expect(result.body[:user_id]).to_not be_nil | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<soapenv:Header> | ||
<platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2013_1.platform.webservices.netsuite.com"> | ||
<platformMsgs:nsId>WEBSERVICES_1050000_022120151347972620982848545_59961c863594</platformMsgs:nsId> | ||
</platformMsgs:documentInfo> | ||
</soapenv:Header> | ||
<soapenv:Body> | ||
<loginResponse xmlns="urn:messages_2013_1.platform.webservices.netsuite.com"> | ||
<sessionResponse> | ||
<platformCore:status xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com" isSuccess="true"/> | ||
<userId xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com" internalId="460362"> | ||
<platformCore:name>REDACTED NAME</platformCore:name> | ||
</userId> | ||
<platformCore:wsRoleList xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com"> | ||
<platformCore:wsRole> | ||
<platformCore:role internalId="1047"> | ||
<platformCore:name>REDACTED ROLE</platformCore:name> | ||
</platformCore:role> | ||
<platformCore:isDefault>false</platformCore:isDefault> | ||
<platformCore:isInactive>false</platformCore:isInactive> | ||
<platformCore:isLoggedInRole>true</platformCore:isLoggedInRole> | ||
</platformCore:wsRole> | ||
<platformCore:wsRole> | ||
<platformCore:role internalId="1047"> | ||
<platformCore:name>REDACTED ROLE</platformCore:name> | ||
</platformCore:role> | ||
<platformCore:isDefault>false</platformCore:isDefault> | ||
<platformCore:isInactive>false</platformCore:isInactive> | ||
<platformCore:isLoggedInRole>true</platformCore:isLoggedInRole> | ||
</platformCore:wsRole> | ||
</platformCore:wsRoleList> | ||
</sessionResponse> | ||
</loginResponse> | ||
</soapenv:Body> | ||
</soapenv:Envelope> |