spec/netsuite/configuration_spec.rb in netsuite-0.2.5 vs spec/netsuite/configuration_spec.rb in netsuite-0.2.6
- old
+ new
@@ -64,16 +64,37 @@
config.auth_header.should eql({
'platformMsgs:passport' => {
'platformCore:email' => 'user@example.com',
'platformCore:password' => 'myPassword',
'platformCore:account' => '1234',
- 'platformCore:role' => { :@type => 'role', :@internalId => '3' },
+ 'platformCore:role' => { :@internalId => '3' },
}
})
end
end
+ describe '#soap_header' do
+ before do
+ config.email = 'user@example.com'
+ config.password = 'myPassword'
+ config.account = 1234
+ end
+
+ it 'adds a new header to the soap header' do
+ config.soap_header = {
+ 'platformMsgs:preferences' => {
+ 'platformMsgs:ignoreReadOnlyFields' => true,
+ }
+ }
+ config.soap_header.should eql({
+ 'platformMsgs:preferences' => {
+ 'platformMsgs:ignoreReadOnlyFields' => true,
+ }
+ })
+ end
+ end
+
describe '#email' do
context 'when the email has been set' do
before do
config.email = 'test@example.com'
end
@@ -141,10 +162,10 @@
it 'defaults to "3"' do
config.role.should == "3"
end
end
end
-
+
describe '#role=' do
it 'sets the role according to the input value' do
config.role = "6"
config.role.should == "6"
end