diff --git a/devops-service/spec/support/shared_validation_specs.rb b/devops-service/spec/support/shared_validation_specs.rb index 487e8d7..4d86657 100644 --- a/devops-service/spec/support/shared_validation_specs.rb +++ b/devops-service/spec/support/shared_validation_specs.rb @@ -37,7 +37,8 @@ RSpec.shared_examples 'field type validation' do |field, *properties| end if properties.include?(:maybe_empty_array) it 'should contain only word symbols' do - expect(build(validated_model_name, field => 'asd-asd')).not_to be_valid + expect(build(validated_model_name, field => '!')).not_to be_valid + expect(build(validated_model_name, field => '/')).not_to be_valid end if properties.include?(:only_word_symbols) it 'should contain elements like role[asd] or recipe[asd]' do @@ -99,9 +100,12 @@ RSpec.shared_examples 'field type validation' do |field, *properties| }.not_to raise_error end if properties.include?(:maybe_empty_array) - it 'should contain only word symbols' do + it 'should contain only symbols in [a-zA-Z0-9_-]' do expect{ - build(validated_model_name, field => 'asd-asd').send(field_validation_method) + build(validated_model_name, field => '!').send(field_validation_method) + }.to raise_error InvalidRecord + expect{ + build(validated_model_name, field => '/').send(field_validation_method) }.to raise_error InvalidRecord end if properties.include?(:only_word_symbols)