diff --git a/src/humulus/styles.py b/src/humulus/styles.py index 533defc..c7c4334 100644 --- a/src/humulus/styles.py +++ b/src/humulus/styles.py @@ -172,9 +172,5 @@ def info(id): def recipes(id): style = get_doc_or_404(id) view = get_view('_design/recipes', 'by-style') - try: - rows = view(include_docs=True, descending=True, key=id)['rows'] - except requests.exceptions.HTTPError: - abort(400) - + rows = view(include_docs=True, descending=True, key=id)['rows'] return render_template('styles/recipes.html', style=style, rows=rows) diff --git a/tests/test_styles.py b/tests/test_styles.py index 23c3933..80a07bc 100644 --- a/tests/test_styles.py +++ b/tests/test_styles.py @@ -219,3 +219,10 @@ def test_info(auth, client): assert response.status_code == 200 assert b'1A' in response.data assert b'Test Style' in response.data + + +def test_recipes(client): + """Test success in retrieving list of recipes matching style.""" + response = client.get('/styles/info/1A/recipes') + assert response.status_code == 200 + assert b'Awesome Beer' in response.data