Skip to content

Instantly share code, notes, and snippets.

@domagude
Created November 2, 2017 18:03
Show Gist options
  • Save domagude/ef0d03034b36e963a19bd39956e32446 to your computer and use it in GitHub Desktop.
Save domagude/ef0d03034b36e963a19bd39956e32446 to your computer and use it in GitHub Desktop.
context 'Scopes' do
it 'default_scope orders by descending created_at' do
first_post = create(:post)
second_post = create(:post)
expect(Post.all).to eq [second_post, first_post]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment