Sha256: 9d9e3197ce8028dd8426a74eebff4d36c455d5fc01e20d0835ce9a734b2bd90c

Contents?: true

Size: 868 Bytes

Versions: 1

Compression:

Stored size: 868 Bytes

Contents

require "spec_helper"

describe "The Smooth Serializer" do
  let(:books) { Smooth.current_api.resource("Books") }
  let(:serializer) { books.fetch(:serializer, "Default") }

  it "should configure the serializer" do
    expect(serializer.schema_attributes).not_to be_empty
  end

  it "should relate to the book model" do
    expect(Book.active_model_serializer).to equal(serializer)
  end

  it "should have documentation for its attributes" do
    expect(serializer.documentation_for_attribute(:title).description).not_to be_blank
  end

  it "should have documentation for its relationships" do
    expect(serializer.documentation_for_association(:author).description).not_to be_blank
  end

  it "should have documentation for its computed properties" do
    expect(serializer.documentation_for_attribute(:computed_property).description).not_to be_blank
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smooth-2.0.1 spec/lib/smooth/serializer_spec.rb