summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 17:23:40 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-07-31 17:23:40 +0300
commitc2c7d14ec51ec8654cc4e0ca57ba0bc146fd8725 (patch)
treea934912a8d8711d5fca2b7a1b3da1ee8b4698519 /spec/support
parentbb2f4d665e946806d0bb94d3a50569ae6aa12e66 (diff)
downloadgitlab-ce-c2c7d14ec51ec8654cc4e0ca57ba0bc146fd8725.tar.gz
Move all test repos data to ReposHelpers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/big_commits.rb8
-rw-r--r--spec/support/repo_helpers.rb67
-rw-r--r--spec/support/valid_commit.rb27
-rw-r--r--spec/support/valid_commit_with_alt_email.rb6
4 files changed, 67 insertions, 41 deletions
diff --git a/spec/support/big_commits.rb b/spec/support/big_commits.rb
deleted file mode 100644
index 69daa709dd9..00000000000
--- a/spec/support/big_commits.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-module BigCommits
- HUGE_COMMIT_ID = "7f92534f767fa20357a11c63f973ae3b79cc5b85"
- HUGE_COMMIT_MESSAGE = "pybments.rb version up. gitignore improved"
-
- BIG_COMMIT_ID = "d62200cad430565bd9f80befaf329297120330b5"
- BIG_COMMIT_MESSAGE = "clean-up code"
-end
-
diff --git a/spec/support/repo_helpers.rb b/spec/support/repo_helpers.rb
new file mode 100644
index 00000000000..2584853077f
--- /dev/null
+++ b/spec/support/repo_helpers.rb
@@ -0,0 +1,67 @@
+module RepoHelpers
+ extend self
+
+ # Text file in repo
+ #
+ # Ex.
+ #
+ # # Get object
+ # blob = RepoHelpers.text_blob
+ #
+ # blob.path # => 'files/js/commit.js.coffee'
+ # blob.data # => 'class Commit...'
+ #
+ def sample_blob
+ OpenStruct.new(
+ path: "files/js/commit.js.coffee",
+ data: <<eos
+class Commit
+ constructor: ->
+ $('.files .diff-file').each ->
+ new CommitFile(this)
+
+@Commit = Commit
+eos
+ )
+ end
+
+ def sample_commit
+ OpenStruct.new(
+ id: "570e7b2abdd848b95f2f578043fc23bd6f6fd24d",
+ parent_id: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9',
+ author_full_name: "Dmitriy Zaporozhets",
+ author_email: "dmitriy.zaporozhets@gmail.com",
+ files_changed_count: 2,
+ message: <<eos
+Change some files
+Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
+eos
+ )
+ end
+
+ def sample_big_commit
+ OpenStruct.new(
+ id: "913c66a37b4a45b9769037c55c2d238bd0942d2e",
+ author_full_name: "Dmitriy Zaporozhets",
+ author_email: "dmitriy.zaporozhets@gmail.com",
+ message: <<eos
+Files, encoding and much more
+Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
+eos
+ )
+ end
+
+ def sample_image_commit
+ OpenStruct.new(
+ id: "2f63565e7aac07bcdadb654e253078b727143ec4",
+ author_full_name: "Dmitriy Zaporozhets",
+ author_email: "dmitriy.zaporozhets@gmail.com",
+ old_blob_id: '33f3729a45c02fc67d00adb1b8bca394b0e761d9',
+ new_blob_id: '2f63565e7aac07bcdadb654e253078b727143ec4',
+ message: <<eos
+Modified image
+Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
+eos
+ )
+ end
+end
diff --git a/spec/support/valid_commit.rb b/spec/support/valid_commit.rb
deleted file mode 100644
index 65ad1d52084..00000000000
--- a/spec/support/valid_commit.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-module ValidCommit
- ID = "570e7b2abdd848b95f2f578043fc23bd6f6fd24d"
- MESSAGE = <<eos
-Change some files
-Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-eos
- AUTHOR_FULL_NAME = "Dmitriy Zaporozhets"
- AUTHOR_EMAIL = "dmitriy.zaporozhets@gmail.com"
-
- FILES = [".foreman", ".gitignore", ".rails_footnotes", ".rspec", ".travis.yml", "CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Procfile", "Procfile.production", "README.md", "Rakefile", "VERSION", "app", "config.ru", "config", "db", "doc", "lib", "log", "public", "resque.sh", "script", "spec", "vendor"]
- FILES_COUNT = 26
-
- C_FILE_PATH = "app/models"
- C_FILES = [".gitkeep", "ability.rb", "commit.rb", "issue.rb", "key.rb", "mailer_observer.rb", "merge_request.rb", "note.rb", "project.rb", "protected_branch.rb", "repository.rb", "snippet.rb", "tree.rb", "user.rb", "users_project.rb", "web_hook.rb", "wiki.rb"]
-
- BLOB_FILE = <<eos
-class Commit
- constructor: ->
- $('.files .diff-file').each ->
- new CommitFile(this)
-
-@Commit = Commit
-eos
-
- BLOB_FILE_PATH = "files/js/commit.js.coffee"
-end
-
diff --git a/spec/support/valid_commit_with_alt_email.rb b/spec/support/valid_commit_with_alt_email.rb
deleted file mode 100644
index 75854c63a59..00000000000
--- a/spec/support/valid_commit_with_alt_email.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-module ValidCommitWithAltEmail
- ID = "1e689bfba39525ead225eaf611948cfbe8ac34cf"
- MESSAGE = "fixed notes logic"
- AUTHOR_FULL_NAME = "Dmitriy Zaporozhets"
- AUTHOR_EMAIL = "dzaporozhets@sphereconsultinginc.com"
-end