Sitelet https://github.com/aasm/aasm/issues/807
Skip to content

RSpec syntax to test guard clauses #807

Description

@Leee-xx

Is your feature request related to a problem? Please describe.
If I add a guard clause, some of my event tests will fail if the guard clause isn't returning true. I either have to mock the guard to return true or add multiple scenarios to test for each guard state.

Describe the solution you'd like
RSpec syntax along the lines of .with_guard(:my_guard) (or something similar to https://github.com/jdliss/shoulda-callback-matchers).

Describe alternatives you've considered
I either have to mock the guard to return true or add multiple scenarios to test for each guard state.

Additional context
n/a

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions