Module: RSpec::Rails::HelperExampleGroup Private

Extended by:
ActiveSupport::Concern
Includes:
ActionView::TestCase::Behavior, RailsExampleGroup, ViewAssigns
Defined in:
lib/rspec/rails/example/helper_example_group.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Container module for helper specs.

Instance Method Summary collapse

Methods included from ViewAssigns

#assign, #view_assigns

Methods included from Matchers

#be_a_new, #be_new_record, #be_valid, #have_http_status

Instance Method Details

#helperObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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



21
22
23
24
25
26
# File 'lib/rspec/rails/example/helper_example_group.rb', line 21

def helper
  _view.tap do |v|
    v.extend(ApplicationHelper) if defined?(ApplicationHelper)
    v.assign(view_assigns)
  end
end