summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-05-30 12:12:42 +0200
committerImre Farkas <ifarkas@gitlab.com>2018-06-06 22:25:20 +0200
commit854c9636ec6aabd8941b31f0f2aa4e89c9c072ce (patch)
treec618473ce420ca8abe707ea1c821a6a94bfc16f5 /spec
parentd8eea0c4ba74a3bc821e1298e85f3fed77273099 (diff)
downloadgitlab-ce-854c9636ec6aabd8941b31f0f2aa4e89c9c072ce.tar.gz
Enforce UTF-8 encoding on user input in LogrageWithTimestamp formatter and filter out file content from logs
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/commits_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index 8ad19e3f0f5..7e3277c4cab 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -247,6 +247,19 @@ describe API::Commits do
]
}
end
+ let!(:valid_utf8_c_params) do
+ {
+ branch: 'master',
+ commit_message: message,
+ actions: [
+ {
+ action: 'create',
+ file_path: 'foo/bar/baz.txt',
+ content: 'puts 🦊'
+ }
+ ]
+ }
+ end
it 'a new file in project repo' do
post api(url, user), valid_c_params
@@ -257,6 +270,15 @@ describe API::Commits do
expect(json_response['committer_email']).to eq(user.email)
end
+ it 'a new file with utf8 chars in project repo' do
+ post api(url, user), valid_utf8_c_params
+
+ expect(response).to have_gitlab_http_status(201)
+ expect(json_response['title']).to eq(message)
+ expect(json_response['committer_name']).to eq(user.name)
+ expect(json_response['committer_email']).to eq(user.email)
+ end
+
it 'returns a 400 bad request if file exists' do
post api(url, user), invalid_c_params