Sha256: 545380169602fc621543f8fdb6feef2394f83d326f90c939e7759624598ad1ab
Contents?: true
Size: 947 Bytes
Versions: 34
Compression:
Stored size: 947 Bytes
Contents
require 'rspec/rails/view_assigns' module RSpec::Rails module HelperExampleGroup extend ActiveSupport::Concern include RSpec::Rails::RailsExampleGroup include ActionView::TestCase::Behavior include RSpec::Rails::ViewAssigns module ClassMethods # @api private 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_group.described_class.to_s.sub(/Helper/,'').underscore end included do metadata[:type] = :helper before do controller.controller_path = _controller_path end end end end
Version data entries
34 entries across 29 versions & 5 rubygems