Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Use model scopes and jbuilder #582

Merged
merged 9 commits into from
Jul 25, 2016
Merged

Use model scopes and jbuilder #582

merged 9 commits into from
Jul 25, 2016

Conversation

Tuuleh
Copy link
Contributor

@Tuuleh Tuuleh commented Jul 20, 2016

Use language and featured scopes in the model instead of additional methods in the controller. Use jbuilder for rendering json responses from the pages api.

let!(:last_featured_page) { create :page, title: 'I am the latest featured page', featured: true, slug: 'garden_slug' }
let!(:last_mvp_page) { create :page, title: 'I am the latest test page', featured: false}
let!(:featured_pages) { create_list :page, 50, featured: true }
let!(:mvp_pages) { create_list :page, 50, featured: false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating 100 records is a bit much. For the integration specs it would be more valuable just checking that a request is met with a json response, and that the response has certain fields present.

@osahyoun osahyoun merged commit 7b68dbc into development Jul 25, 2016
@osahyoun osahyoun deleted the pages-api-cleanup branch July 25, 2016 11:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants