Created
July 27, 2022 10:17
-
-
Save channainfo/7ce691c8c13aff29baa924f39956857b to your computer and use it in GitHub Desktop.
Disable callback in rspec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Disable XLIFF validation for all specs | |
config.before :all do | |
XliffUploader._before_callbacks.delete(:store) | |
end | |
#Enable XLIFF validation only for specs with ":enable_xliff_validation => true" | |
config.before :each, :enable_xliff_validation => true do | |
XliffUploader._before_callbacks[:store] = [:validate_xliff] | |
end | |
config.after :each, :enable_xliff_validation => true do | |
XliffUploader._before_callbacks.delete(:store) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment