summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-09-07 10:58:19 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-09-07 11:26:07 +0530
commit0f44c5a56fdc5986797808c508d7b42236cee450 (patch)
tree423d79a1157e375984615adf619310c5a6b8ad78 /spec/support
parent71a9bcd3def27a46223ea052e7fe3560869b9d6d (diff)
downloadgitlab-ce-0f44c5a56fdc5986797808c508d7b42236cee450.tar.gz
Generate branch/file names more randomly to avoid failures.
- Tests would randomly fail because of naming conflicts. - Use a `random_git_name` method instead of using `FFaker` directly.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/git_helpers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/git_helpers.rb b/spec/support/git_helpers.rb
new file mode 100644
index 00000000000..93422390ef7
--- /dev/null
+++ b/spec/support/git_helpers.rb
@@ -0,0 +1,9 @@
+module GitHelpers
+ def random_git_name
+ "#{FFaker::Product.brand}-#{FFaker::Product.brand}-#{rand(1000)}"
+ end
+end
+
+RSpec.configure do |config|
+ config.include GitHelpers
+end