Skip to content

Instantly share code, notes, and snippets.

@ejholmes
Created March 12, 2012 21:02
Show Gist options
  • Save ejholmes/2024666 to your computer and use it in GitHub Desktop.
Save ejholmes/2024666 to your computer and use it in GitHub Desktop.
# @order is created before each test runs
it "allows for the navision Id to be specified rather than the salesforce Id" do
@order.Status__c.should eq('Processing')
body = {
:order => {
:id => @order.Id,
:Status__c => "Processed",
:NavisionID__c => "testxxx_navision_id"
}
}
post('/services/apexrest/orders/v1/', body)
@order.reload
@order.Status__c.should eq('Processed')
@order.NavisionID__c.should eq('testxxx_navision_id')
body = {
:order => {
:NavisionID__c => "testxxx_navision_id",
:Status__c => "Shipped",
:TrackingNumbers__c => "tracking1\ntracking2"
}
}
post('/services/apexrest/orders/v1/', body)
@order.reload
@order.Status__c.should eq('Shipped')
# After reloading the order from Salesforce, the Navision ID is still present.
@order.NavisionID__c.should eq('testxxx_navision_id')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment