Sha256: e382de9dc8260e4b6fae329a2dc0a67f575f082cb25ac289eb323e1ed0358f73
Contents?: true
Size: 1005 Bytes
Versions: 20
Compression:
Stored size: 1005 Bytes
Contents
require 'spec_helper' describe RestPack::Serializer::Factory do let(:factory) { RestPack::Serializer::Factory } it "creates by string" do factory.create("Song").should be_an_instance_of(MyApp::SongSerializer) end it "creates by lowercase string" do factory.create("song").should be_an_instance_of(MyApp::SongSerializer) end it "creates by lowercase plural string" do factory.create("songs").should be_an_instance_of(MyApp::SongSerializer) end it "creates by symbol" do factory.create(:song).should be_an_instance_of(MyApp::SongSerializer) end it "creates by class" do factory.create(MyApp::Song).should be_an_instance_of(MyApp::SongSerializer) end it "creates multiple with Array" do serializers = factory.create("Song", "artists", :album) serializers[0].should be_an_instance_of(MyApp::SongSerializer) serializers[1].should be_an_instance_of(MyApp::ArtistSerializer) serializers[2].should be_an_instance_of(MyApp::AlbumSerializer) end end
Version data entries
20 entries across 20 versions & 1 rubygems