Skip to main content

Module fake

Module fake 

Source
Expand description

A Grab with no network, for tests and local development. Nothing here reaches Grab; every merchant, item and order is made up.

  • Login: a phone ending in 1 is approved in the app (after two waits); one ending in 9 hits a reCAPTCHA step-up (failed); any other gets a code, 123456.
  • The session is {"fake": true, "account": "<name>", "n": <refreshes>}; "dead": true in it makes every call need a re-login.
  • Two merchants, a cart in memory per session account, a quote id that is a hash of the cart, orders that only count up.

Fake::session makes a connected session without a login.

Structs§

Fake
The fake backend; its orders are counted (the tests check that an order went through once, or never).
FakeLogin
The fake’s login (see the module’s docs for which phones do what).

Constants§

FAKE_CODE
The fake’s code.