module RSpec::Rails::HelperExampleGroup

@api public Container module for helper specs.

Public Instance Methods

helper() click to toggle source

Returns an instance of ActionView::Base with the helper being specified mixed in, along with any of the built-in rails helpers.

# File lib/rspec/rails/example/helper_example_group.rb, line 22
def helper
  _view.tap do |v|
    v.extend(ApplicationHelper) if defined?(ApplicationHelper)
    v.assign(view_assigns)
  end
end

Private Instance Methods

_controller_path(example) click to toggle source
# File lib/rspec/rails/example/helper_example_group.rb, line 31
def _controller_path(example)
  example.example_group.described_class.to_s.sub(/Helper/, '').underscore
end