Add linter for serializable resource

This commit is contained in:
Benjamin Fleischer
2015-07-09 10:34:35 -05:00
parent 952d8adcdc
commit 28174e297d
3 changed files with 162 additions and 0 deletions

44
test/lint_test.rb Normal file
View File

@@ -0,0 +1,44 @@
require 'test_helper'
module ActiveModel
class Serializer
class LintTest < Minitest::Test
include ActiveModel::Serializer::Lint::Tests
class CompliantResource
def serializable_hash(options = nil)
end
def read_attribute_for_serialization(name)
end
def as_json(options = nil)
end
def to_json(options = nil)
end
def cache_key
end
def id
end
def self.model_name
@_model_name ||= ActiveModel::Name.new(self)
end
end
def setup
@resource = CompliantResource.new
end
end
end
end