Last active
December 18, 2015 21:39
-
-
Save theodorton/5848796 to your computer and use it in GitHub Desktop.
Support file for RSpec aimed at DRYing up ActiveModel Serializer specs.
This file contains 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
describe BlogPostSerializer do | |
include_context "serializer spec" | |
let(:model) do | |
BlogPost.new({ | |
title: "Lol", | |
author_attributes: { email: "john@doe.com"} | |
}) | |
end | |
within('blog_post') do | |
its(['title']).should eq('Lol') | |
within('author') do | |
its(['email']).should eq('john@doe.com') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment