Inspecting 1484 files
.......................................C....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
app/controllers/admin/proxy_orders_controller.rb:16:35: C: [Corrected] Rails/I18nLazyLookup: Use "lazy" lookup for the text used in controllers.
render json: { errors: [t('admin.proxy_orders.cancel.could_not_cancel_the_order')] },
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/proxy_orders_controller.rb:25:35: C: [Corrected] Rails/I18nLazyLookup: Use "lazy" lookup for the text used in controllers.
render json: { errors: [t('admin.proxy_orders.resume.could_not_resume_the_order')] },
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1484 files inspected, 2 offenses detected, 2 offenses corrected
Similar to tax included in price scenario, adds a test for percentage
based voucher to check the adjustments are recalculated when needed.
Plus fix tax incluced in price specs to use new factory
It is important that the calculated voucher adjustments don't change
if they are recalculated and it is equally important that they are
updated if the order has changed
The PDF reader can't always place text elements in the right place. So
something that should be in one line can be in multiple lines and those
lines can be in a different order. I'm asserting the moving parts
separately as done in other places of this spec.
The validation of ActsAsTaggableOn::Taggable failed when trying to copy
tag ids during cloning. But I found that it's totally unnecessary
because `Exchange.dup` copies the `tag_list` attribute already and it
gets saved correctly. There's an existing spec for this.
Unless they state otherwise.
The new standard also changes the default behaviour of the Shoulda
matcher in Rspec. It now defaults to asserting that an association is
required. That needed some spec updates.
In one case, Spree::Product, I also had to update the model because the
presence validation was somehow not recognised by the Shoulda matcher.
The error message may change slightly but the outcome should be the
same.
It would take ages to go through all files now and assess all belongs_to
associations. So I just declare the old default and then we can move on
and apply the new default for the application while these classes still
use the old one. All new models will then use the new default which is
the goal of this excercise and we can refactor old classes when we touch
them anyway.
I had to change some specs to keep them simple but I don't think
anything is broken. In one case, it would have needed a lot more setup
to make the spec work. But in production, the permissions are never used
with ModelSet, for example.