Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GitHub Mirror
2factorauth
twofactorauth
Commits
5e0f2f45
Unverified
Commit
5e0f2f45
authored
Jan 29, 2022
by
Arun Pattni
Committed by
GitHub
Jan 29, 2022
Browse files
Subdirectory name test (#6449)
parent
2b873a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/validate-json.rb
View file @
5e0f2f45
...
...
@@ -64,6 +64,15 @@ Dir.glob('entries/*/*.json') do |file|
"File name should be the same as the domain name. Received:
#{
file_name
}
. Expected:
#{
expected_file_name
}
"
)
end
folder_name
=
file
.
split
(
'/'
)[
1
]
expected_folder_name
=
document
.
values
[
0
][
'domain'
][
0
]
unless
folder_name
.
eql?
expected_folder_name
error
(
file
,
"Entry should be in the subdirectory with the same name as the first letter as the domain.
Received: entries/
#{
folder_name
}
. Expected: entries/
#{
expected_folder_name
}
"
)
end
name
=
document
.
keys
[
0
]
if
seen_names
.
include?
name
error
(
file
,
"An entry with the name '
#{
name
}
' already exists. Duplicate site names are not allowed.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment