jeudi 9 janvier 2020

Rails integration test: my test posts a new entry to the controller, how do I retrieve this entry?

I am having a problem knowing how to retrieve the new entry my test just posted. Here's my code:

post admin_bundles_path, params: { bundle: {
    title: "New bundle",
    sku: "ASD-FESTA-00001-XM",
} }, xhr: true
assert_response :ok

So far, so good. Now, how do I check the attributes of this new entry? The older entries are on my fixtures, so I can access them by bundles(:some_bundle), for example. How do I do it for the new one?

Aucun commentaire:

Enregistrer un commentaire