diff options
Diffstat (limited to 'spec/support/helpers/filter_spec_helper.rb')
-rw-r--r-- | spec/support/helpers/filter_spec_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/helpers/filter_spec_helper.rb b/spec/support/helpers/filter_spec_helper.rb index ca844b33ba8..7beed9c7755 100644 --- a/spec/support/helpers/filter_spec_helper.rb +++ b/spec/support/helpers/filter_spec_helper.rb @@ -90,10 +90,11 @@ module FilterSpecHelper # # Returns a String def invalidate_reference(reference) - if reference =~ /\A(.+)?[^\d]\d+\z/ + case reference + when /\A(.+)?[^\d]\d+\z/ # Integer-based reference with optional project prefix reference.gsub(/\d+\z/) { |i| i.to_i + 10_000 } - elsif reference =~ /\A(.+@)?(\h{7,40}\z)/ + when /\A(.+@)?(\h{7,40}\z)/ # SHA-based reference with optional prefix reference.gsub(/\h{7,40}\z/) { |v| v.reverse } else |