Sha256: 0589547aa643f6b5475ca6b50a600cdd63a0ae1ec79abf3de87b9a566d0a5094

Contents?: true

Size: 908 Bytes

Versions: 3

Compression:

Stored size: 908 Bytes

Contents

module SupportMethods
  def setup
    @controller = Class.new do
      attr_reader :url_for_options
      def url_for(options, *parameters_for_method_reference)
        @url_for_options = options
        "http://www.example.com"
      end

      def request;  @request  ||= ActionController::TestRequest.new;  end
      def response; @response ||= ActionController::TestResponse.new; end
    end
    @controller = @controller.new
    @article = OpenStruct.new(:body => nil)
  end

  def request
    @controller.request
  end

  def controller
    setup
  end

  def config
    Class.new do
      class << self
        def perform_caching
          true
        end

        def asset_path
          @asset_path
        end

        def assets_dir
          ""
        end

        def relative_url_root
          nil
        end

        def asset_host
          nil
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
textile_editor_helper-0.1.4 test/support_methods.rb
textile_editor_helper-0.1.3 test/support_methods.rb
textile_editor_helper-0.1.2 test/support_methods.rb