Skip to content

Instantly share code, notes, and snippets.

@dmitrym0
Created March 24, 2014 19:44
Show Gist options
  • Save dmitrym0/9747598 to your computer and use it in GitHub Desktop.
Save dmitrym0/9747598 to your computer and use it in GitHub Desktop.
it "throws an error if bookguid has been reused" do
payload = {:bookGuid => "ABC123", :backingFile=> "/tmp/test.epub", :previewPercentage => "10", :queueItemId => SecureRandom.uuid};
Rm::Api::OnboardingController.any_instance.stubs(:does_guid_exist?).returns(true)
get :onboarding, payload
response.status.should == 400
json = JSON.parse(response.body)
json["ErrorCode"].should include "DUPLICATE_GUID"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment