Commit 0e6ef209 authored by Michael Kozono's avatar Michael Kozono

Avoid copy paste problems

parent 19ade869
......@@ -3,6 +3,7 @@
class GeoNode < ApplicationRecord
include Presentable
include Geo::SelectiveSync
include StripAttribute
SELECTIVE_SYNC_TYPES = %w[namespaces shards].freeze
......@@ -55,6 +56,8 @@ class GeoNode < ApplicationRecord
mode: :per_attribute_iv,
encode: true
strip_attributes :name
class << self
# Set in gitlab.rb as external_url
def current_node_url
......
......@@ -671,4 +671,16 @@ describe GeoNode, :geo, type: :model do
is_expected.to be_falsy
end
end
describe '#name=' do
context 'before validation' do
it 'strips leading and trailing whitespace' do
node = build(:geo_node)
node.name = " foo\n\n "
node.valid?
expect(node.name).to eq('foo')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment