Skip to content

NameError: undefined local variable or method `main_app' #11

@rthbound

Description

@rthbound

When attempting to access routes defined within a mounted engine, I find:

NameError: undefined local variable or method `patient_manager' for #<Spinach::Features::HealthyHeartsPatientProfile:0xc37d668>

Likewise when specifying the main_app, I see a similar error:

NameError: undefined local variable or method `main_app' for #<Spinach::Features::HealthyHeartsPatientProfile:0xc37d668>

In development:

$ bundle exec rails c
> app.main_app.root_path
 => "/"
> app.patient_manager.root_path
 => "/"

However, during my spinach tests

[1] pry(#<Spinach::Features::HealthyHeartsPatientProfile>)> patient_manager.root_path
 NameError: undefined local variable or method `patient_manager' for #<Spinach::Features::HealthyHeartsPatientProfile:0xc37d668>
 from /home/rt/.rvm/gems/ruby-1.9.3-p327@nv_medicaid_mri/gems/rspec-expectations-2.12.1/lib/rspec/matchers/method_missing.rb:9:in `method_missing'

The same NameError occurs when calling "main_app"... I can simply call "root_path", however I have no way to specify whether I want the application's path or the engine's path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions