Module: RSpec::Rails::ViewExampleGroup::ClassMethods

Defined in:
lib/rspec/rails/example/view_example_group.rb

Instance Method Summary collapse

Instance Method Details

#_default_helperObject



35
36
37
38
39
40
# File 'lib/rspec/rails/example/view_example_group.rb', line 35

def _default_helper
  base = [:behaviour][:description].split('/').first
  (base.camelize + 'Helper').constantize if base
rescue NameError
  nil
end

#_default_helpersObject



42
43
44
45
46
# File 'lib/rspec/rails/example/view_example_group.rb', line 42

def _default_helpers
  helpers = [_default_helper].compact
  helpers << ApplicationHelper if Object.const_defined?('ApplicationHelper')
  helpers
end