Created
March 17, 2016 02:18
-
-
Save BenMorganIO/726227bf0d46499af8f5 to your computer and use it in GitHub Desktop.
Serializer Example - Medium Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Medium | |
| class PostSerializer < ApplicationSerializer | |
| attributes :title, :description | |
| end | |
| end | |
| describe Medium::PostSerializer do | |
| let(:post) { build :post } | |
| subject { build_serializer post } | |
| [:post, :description].each do |attribute| | |
| its(:attributes) { should include attribute } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment