Bug 23843: Make funds endpoint tests more robust
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 21 Oct 2019 18:18:32 +0000 (15:18 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 23 Oct 2019 17:02:47 +0000 (18:02 +0100)
commitecf030b798297d19926ca037507271ad4c100bfd
treec0decea31f52a757efdfc12406e5328003516055
parent99a1a6db0f720cf0896a5ea2651cce89e35384ae
Bug 23843: Make funds endpoint tests more robust

Now that we use ->to_api all the object attributes are returned, so the
original tests that didn't follow the FKs would pass, and now they
don't. If there is no budget linked to the fund, it will return undef,
which is not accepted on the API (though it accepts not returning the
attribute).

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/acquisitions_funds.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/db_dependent/api/v1/acquisitions_funds.t