tests: add normalize_attribute helper method.

Add a custom Shoulda matcher for testing that a model correctly normalizes an attribute.

Usage:

    subject { build(:wiki_page) }
    should normalize_attribute(:title).from(" Azur  Lane ").to("azur_lane")
This commit is contained in:
evazion
2021-01-09 18:40:21 -06:00
parent 9759701071
commit ff6e640fcb
3 changed files with 53 additions and 8 deletions

View File

@@ -27,6 +27,7 @@ class ActiveSupport::TestCase
include IqdbTestHelper
include UploadTestHelper
extend StripeTestHelper
extend NormalizeAttributeHelper
mock_post_version_service!
mock_pool_version_service!