Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle AASM::InvalidTransition in RSpec transition_from matcher #653

Merged

Conversation

ryanwood
Copy link
Contributor

@ryanwood ryanwood commented Nov 6, 2019

When using the transition_from RSpec matcher, it returns false when the "from" state is valid but raises an exception when the "from" state is not valid. This commit aligns the two paths so the matcher will return false in both scenarios.

This properly returns false vs raising an AASM::InvalidTransition
error when running specs.
@codeclimate
Copy link

codeclimate bot commented Nov 6, 2019

Code Climate has analyzed commit 9746cc4 and detected 0 issues on this pull request.

View more on Code Climate.

@codecov-io
Copy link

codecov-io commented Nov 6, 2019

Codecov Report

Merging #653 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
+ Coverage   95.17%   95.18%   +<.01%     
==========================================
  Files          35       35              
  Lines        1224     1226       +2     
==========================================
+ Hits         1165     1167       +2     
  Misses         59       59
Impacted Files Coverage Δ
lib/aasm/rspec/transition_from.rb 85% <100%> (+1.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31a3d83...9746cc4. Read the comment docs.

@anilmaurya anilmaurya merged commit bf9ea19 into aasm:master Nov 8, 2019
@anilmaurya
Copy link
Member

Thanks for contributing @ryanwood

@a-kharkov a-kharkov mentioned this pull request Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants