Skip to content

Refactors on Controller tests #1112

Open

Description

Most of our controller tests make calls like this: expect(get: author_root_path).to route_to(controller: 'author/submissions', action: 'index')

This is not really a controller test. The actual code within the code is not called; rather, it just tests the routing. We have these same type tests in spec/routing/etda_workflow_routing_spec.rb. We should move any test that is primarily concerning with routing to the routing spec.

Controller specs have been "soft-deprecated" by rspec. For tests that go beyond just testing that a route calls a controller action (eg spec/controllers/author/submissions_controller_spec.rb:31), we should replace them with request specs. Note that we already have some request specs in place, so check to make sure that it doesn't already exist first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorImproves the quality of the code

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions