Top Level Namespace

Defined Under Namespace

Modules: Devise, Lesli, LesliHelper, MigrationHelpers, ResponseRequestHelper, ServiceResponseHelpers Classes: Date2

Instance Method Summary collapse

Instance Method Details

#build_engine_path(engine_name, path) ⇒ Object

· Dynamically build a path where the engine is mounted



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rspec/testers/request.rb', line 41

def build_engine_path(engine_name, path)

    # get the engine information
    engine = LesliSystem.engine(engine_name)

    # return the path if no engine found
    return path unless engine

    engine_constant = engine[:name].constantize

    # build the path inside the engine mounted path
    "#{engine_constant::Engine.routes.find_script_name({})}/#{path}"
end