Closed Plsr closed 6 years ago
we could add some more tests.
for example that the form fields are pre-filled if a certain URL is given. The HTTP requests should be mocked for this.
merging this, but feel free to add the test if you want.
@Plsr fyi. I've refactored the posts#new action a bit. And actually that code could also be moved into the model, which could make it even smaller and easier to test I think. The mothod would then do nothing else except the meta inspector stuff and it can easily be tested for the return value and if the post attributes are filled. - just fyi.
Split the
post#new
flow in to steps. In the first (/add
), the user may provide a URL. The controller then tries to parse metadata from the URL and prefill the/new
form. If a invalid URL is provided (or some other error occurs while parsing the URL), the user is redirected to an empty/new
form.ToDo:
Closes #11