Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Punto 2 #63

Open
juaampialvarez opened this issue May 19, 2019 · 0 comments
Open

Punto 2 #63

juaampialvarez opened this issue May 19, 2019 · 0 comments

Comments

@juaampialvarez
Copy link

Nos pide crear una película mediante la API y que exista en la base de datos.
No sabemos como recuperar la película como para compararla.

test('Crear película por API', async () => {
const movieData = {
title: 'Back to the Future',
description: 'Marty McFly, a 17-year-old high school student, is accidentally sent thirty years into the past in a time-traveling DeLorean invented by his close friend, the maverick scientist Doc Brown.',
year: 1985,
runtime: 116,
country: 'United States',
language: 'English',
genres: ['Adventure', 'Comedy', 'Science Fiction'],
directors: ['Robert Zemeckis'],
writers: ['Robert Zemeckis', 'Bob Gale']
};
const URL = ${baseURL}/movies;
const req = await fetch(URL)
await fetch(URL, {
method: 'POST',
body: JSON.stringify(movieData),
headers: { 'Content-Type': 'application/json' },
})

const recivedMovie = await MovieModels.get(1);

expect(recivedMovie.title).toBe('Back to the Future');


// Completar test

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant