Sha256: 3973ebcf54d7b1937de19ef86770007a393cd3f81b3b44b714d47ee51329aa87
Contents?: true
Size: 942 Bytes
Versions: 1
Compression:
Stored size: 942 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.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
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspec-rails-3.0.0.rc1 | lib/rspec/rails/example/helper_example_group.rb |