Class: ViewSpec::Group
Instance Method Summary
collapse
Methods inherited from Entry
#initialize, #method_missing, #respond_to_missing?, #short_identifier, #source_file, #spec, #title, #to_partial_path, type
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class ViewSpec::Entry
Instance Method Details
#notes ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/view_spec/group.rb', line 11
def notes
if context.notes.present? || scenarios.filter { _1.notes? }.any?
ViewSpec.config.preview_controller.render(
partial: "view_specs/group/notes",
locals: {group: self, notes: context.notes}
)
end
end
|
#notes? ⇒ Boolean
20
21
22
|
# File 'lib/view_spec/group.rb', line 20
def notes?
notes.present?
end
|
#preview(**options) ⇒ Object
3
4
5
|
# File 'lib/view_spec/group.rb', line 3
def preview(**options)
GroupPreview.new(self, **options)
end
|
#preview? ⇒ Boolean
7
8
9
|
# File 'lib/view_spec/group.rb', line 7
def preview?
scenarios.any? { _1.preview? }
end
|
#to_param ⇒ Object
24
25
26
|
# File 'lib/view_spec/group.rb', line 24
def to_param
short_identifier
end
|