Module: Graphiti::SpecHelpers::Matchers
- Defined in:
- lib/graphiti/spec_helpers/matchers.rb
Overview
Assertions against a resource's DSL. The schema specs cannot cover
adapter-dependent options (primary key, foreign key, and so on) because
the schema does not carry them; these read the resource config directly.
Defined Under Namespace
Classes: BaseMatcher, BelongsToMatcher, ExposeAttributeMatcher, FilterAttributeMatcher, HasManyMatcher, HasOneMatcher, RelationMatcher, ResourceDSLMatcher
Instance Method Summary
collapse
Instance Method Details
#belong_to_resource(relation) ⇒ Object
154
155
156
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 154
def belong_to_resource(relation)
BelongsToMatcher.new(relation)
end
|
#expose_attribute(attribute, type) ⇒ Object
182
183
184
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 182
def expose_attribute(attribute, type)
ExposeAttributeMatcher.new(attribute, type)
end
|
#filter_attribute(attribute, type) ⇒ Object
192
193
194
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 192
def filter_attribute(attribute, type)
FilterAttributeMatcher.new(attribute, type)
end
|
#have_many_resources(relation) ⇒ Object
163
164
165
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 163
def have_many_resources(relation)
HasManyMatcher.new(relation)
end
|
#have_one_resource(relation) ⇒ Object
172
173
174
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 172
def have_one_resource(relation)
HasOneMatcher.new(relation)
end
|