bumi / decent-organizations

A collection of resources for decent organizations
http://bumi.github.io/decent-organizations
3 stars 1 forks source link

Parse metadata from URLs #26

Closed Plsr closed 6 years ago

Plsr commented 6 years ago

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

bumi commented 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.

bumi commented 6 years ago

merging this, but feel free to add the test if you want.

bumi commented 6 years ago

@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.