Skip to content

rails generators not respecting RSpec's default_path #2507

@vivekmiyani

Description

@vivekmiyani

What Ruby, Rails and RSpec versions are you using?

Ruby version: 3.0
Rails version: 6.1.3.2
RSpec version: main

Other RSpec configuration

RSpec is configured to use behaviour directory i.e.

RSpec.configure do |c|
  c.default_path = "behavior"
end

Observed behaviour

When running rspec generator by default spec directory got chosen

$ rails generate rspec:model user
    ...
    create  spec/models/user_spec.rb
    ...

Expected behaviour

Generator should place file inside behaviour directory instead.

$ rails generate rspec:model user
    ...
    create  behaviour/models/user_spec.rb
    ...

Can you provide an example app?

I don't have any at the moment.

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