Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-24 23:11:10 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-24 23:11:10 +0300
commit705f15587bfbfde33ae10f7820e66370a054ad5a (patch)
treeb6fe81fe6302e6f5fe095e1e8d9d59f7419f3ed5 /app/services/files
parent38a7a5f4bc80265ba84bd49e951becfa54745518 (diff)
Fix spec
Diffstat (limited to 'app/services/files')
-rw-r--r--app/services/files/create_service.rb2
-rw-r--r--app/services/files/multi_service.rb6
-rw-r--r--app/services/files/update_service.rb2
3 files changed, 5 insertions, 5 deletions
diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb
index ec45a60eda1..65b5537fb68 100644
--- a/app/services/files/create_service.rb
+++ b/app/services/files/create_service.rb
@@ -16,7 +16,7 @@ module Files
def validate
super
- if @file_content.empty?
+ if @file_content.nil?
raise_error("You must provide content.")
end
diff --git a/app/services/files/multi_service.rb b/app/services/files/multi_service.rb
index ba99af00e96..0609c6219e7 100644
--- a/app/services/files/multi_service.rb
+++ b/app/services/files/multi_service.rb
@@ -21,7 +21,7 @@ module Files
def validate
super
-
+
params[:actions].each_with_index do |action, index|
if ACTIONS.include?(action[:action].to_s)
action[:action] = action[:action].to_sym
@@ -102,13 +102,13 @@ module Files
raise_error("Your changes could not be committed because a file with the name `#{action[:file_path]}` already exists.")
end
- if action[:content].empty?
+ if action[:content].nil?
raise_error("You must provide content.")
end
end
def validate_update(action)
- if action[:content].empty?
+ if action[:content].nil?
raise_error("You must provide content.")
end
diff --git a/app/services/files/update_service.rb b/app/services/files/update_service.rb
index 462de06b6ff..54e1aaf3f67 100644
--- a/app/services/files/update_service.rb
+++ b/app/services/files/update_service.rb
@@ -18,7 +18,7 @@ module Files
def validate
super
- if @file_content.empty?
+ if @file_content.nil?
raise_error("You must provide content.")
end