Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
62c77617
Commit
62c77617
authored
Oct 20, 2020
by
derek-knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 'null' to null bug
parent
a8c179ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/controllers/projects/static_site_editor_controller.rb
app/controllers/projects/static_site_editor_controller.rb
+2
-0
spec/controllers/projects/static_site_editor_controller_spec.rb
...ontrollers/projects/static_site_editor_controller_spec.rb
+6
-1
No files found.
app/controllers/projects/static_site_editor_controller.rb
View file @
62c77617
...
@@ -47,6 +47,8 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
...
@@ -47,6 +47,8 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
payload
.
transform_values
do
|
value
|
payload
.
transform_values
do
|
value
|
if
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Integer
)
if
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Integer
)
value
value
elsif
value
.
nil?
''
else
else
value
.
to_json
value
.
to_json
end
end
...
...
spec/controllers/projects/static_site_editor_controller_spec.rb
View file @
62c77617
...
@@ -105,7 +105,8 @@ RSpec.describe Projects::StaticSiteEditorController do
...
@@ -105,7 +105,8 @@ RSpec.describe Projects::StaticSiteEditorController do
foo:
'bar'
foo:
'bar'
}
}
},
},
a_boolean:
true
a_boolean:
true
,
a_nil:
nil
}
}
end
end
...
@@ -130,6 +131,10 @@ RSpec.describe Projects::StaticSiteEditorController do
...
@@ -130,6 +131,10 @@ RSpec.describe Projects::StaticSiteEditorController do
it
'serializes data values which are hashes to JSON'
do
it
'serializes data values which are hashes to JSON'
do
expect
(
assigns_data
[
:a_hash
]).
to
eq
(
'{"a_deeper_hash":{"foo":"bar"}}'
)
expect
(
assigns_data
[
:a_hash
]).
to
eq
(
'{"a_deeper_hash":{"foo":"bar"}}'
)
end
end
it
'serializes data values which are nil to an empty string'
do
expect
(
assigns_data
[
:a_nil
]).
to
eq
(
''
)
end
end
end
end
end
end
end
...
...
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