Skip to content

Instantly share code, notes, and snippets.

@nyku
Created September 11, 2013 09:15
Show Gist options
  • Save nyku/6521223 to your computer and use it in GitHub Desktop.
Save nyku/6521223 to your computer and use it in GitHub Desktop.
Simple way of testing ActiveModel Serializers
class SimpleSerializer < ActiveModel::Serializer
attributes :name, :code
end
require 'spec_helper'
describe SimpleSerializer do
context "Object methods" do
describe "#to_json" do
it "generates correct JSON" do
SimpleSerializer._attributes.keys.should == [:name, :code]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment