Skip to content

Improve generated request specs when no controller actions are added #2375

Closed
@klyonrad

Description

@klyonrad

Is your feature request related to a problem? Please describe.

When controller generator is used it generates a requests_spec file that is quite empty. It consists only of the describe .. do .. end block without any helping indication that the user can use stuff like expect(response).to have_http_status(200) like it happens when the simpler RequestSpecGenerator is used.

Describe the solution you'd like

when generating a controller the request spec generated will have a different file name and when it is generated without any action it will add just one spec for an index action with a message about adding a real spec.

Describe alternatives you've considered

TBD

Additional context

This issue is extracted from a wish in #2356

I had the idea that we can move the original PR along by separating the issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions