/
params.rb
51 lines (50 loc) · 2.67 KB
/
params.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
VALID_PARAMS = [
{ camelize: true, include_namespaces: true, include_root: true,
root: 'root', namespaces_nesting_level: 3 },
{ camelize: false, include_namespaces: true, include_root: true,
root: :root, namespaces_nesting_level: 3 },
{ camelize: false, include_namespaces: false, include_root: true,
root: nil, namespaces_nesting_level: 3 },
{ camelize: false, include_namespaces: false, include_root: false,
root: :root, namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: false, include_root: false,
root: 'root', namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: true, include_root: false,
root: nil, namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: false, include_root: true,
root: 'root', namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: false, include_root: true,
root: :root, namespaces_nesting_level: 435 },
{ camelize: true, include_namespaces: false, include_root: true,
root: nil, namespaces_nesting_level: 666 },
].freeze
INVALID_PARAMS = [
{ camelize: 'NO', include_namespaces: false, include_root: true,
root: 'root', namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: 'false', include_root: true,
root: :root, namespaces_nesting_level: 3 },
{ camelize: true, include_namespaces: false, include_root: true,
root: 'root', namespaces_nesting_level: 0 },
{ camelize: true, include_namespaces: false, include_root: false,
root: :root, namespaces_nesting_level: -3 },
{ camelize: true, include_namespaces: false, include_root: 'yep',
root: 'root', namespaces_nesting_level: 3 },
{ camelize: 'NO', include_namespaces: false, include_root: true,
root: :root, namespaces_nesting_level: '3' },
{ camelize: 'NO', include_namespaces: false, include_root: true,
root: 'root', namespaces_nesting_level: 3.14 },
{ camelize: Integer, include_namespaces: false, include_root: true,
root: :root, namespaces_nesting_level: 3 },
{ camelize: 'NO', include_namespaces: 'no', include_root: true,
root: 'root', namespaces_nesting_level: '3.4' },
{ camelize: 'f', include_namespaces: false, include_root: 't',
root: :root, namespaces_nesting_level: true },
{ camelize: true, include_namespaces: false, include_root: true,
root: '', namespaces_nesting_level: 666 },
{ camelize: true, include_namespaces: false, include_root: true,
root: 3, namespaces_nesting_level: 666 },
{ camelize: true, include_namespaces: false, include_root: true,
root: -3, namespaces_nesting_level: 666 },
{ camelize: true, include_namespaces: false, include_root: true,
root: 3.14, namespaces_nesting_level: 666 },
].freeze