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
153
154
155
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 153
def belong_to_resource(relation)
BelongsToMatcher.new(relation)
end
|
#expose_attribute(attribute, type) ⇒ Object
181
182
183
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 181
def expose_attribute(attribute, type)
ExposeAttributeMatcher.new(attribute, type)
end
|
#filter_attribute(attribute, type) ⇒ Object
191
192
193
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 191
def filter_attribute(attribute, type)
FilterAttributeMatcher.new(attribute, type)
end
|
#have_many_resources(relation) ⇒ Object
162
163
164
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 162
def have_many_resources(relation)
HasManyMatcher.new(relation)
end
|
#have_one_resource(relation) ⇒ Object
171
172
173
|
# File 'lib/graphiti/spec_helpers/matchers.rb', line 171
def have_one_resource(relation)
HasOneMatcher.new(relation)
end
|