Sha256: 66fe9893d488110e32324c742e640e2d549fb6d0b668ed5899c649eb97c4fe8d
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
require 'rspec/rails/view_assigns' module RSpec module Rails # @api public # Container module for helper specs. module HelperExampleGroup extend ActiveSupport::Concern include RSpec::Rails::RailsExampleGroup include ActionView::TestCase::Behavior include RSpec::Rails::ViewAssigns # @private module ClassMethods def determine_default_helper_class(_ignore) described_class end end # Returns an instance of ActionView::Base with the helper being specified # mixed in, along with any of the built-in rails helpers. def helper _view.tap do |v| v.extend(ApplicationHelper) if defined?(ApplicationHelper) v.assign(view_assigns) end end private def _controller_path(example) example.example_group.described_class.to_s.sub(/Helper/, '').underscore end included do before do |example| controller.controller_path = _controller_path(example) end end end end end
Version data entries
4 entries across 4 versions & 2 rubygems