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:
authorRobert Speicher <rspeicher@gmail.com>2015-05-27 01:43:14 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-06-03 03:32:07 +0300
commit39d5a4878fea8aa631c6b614bdebb9be7b975e79 (patch)
treeca0a270da8ce4d303a72ad210b86a7c4682a06ed /spec/javascripts/extensions
parent456095440425f91028f218748f366bf16e5c7d4b (diff)
Add JS specs for Array extensions
Diffstat (limited to 'spec/javascripts/extensions')
-rw-r--r--spec/javascripts/extensions/array_spec.js.coffee12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/extensions/array_spec.js.coffee b/spec/javascripts/extensions/array_spec.js.coffee
new file mode 100644
index 00000000000..4ceac619422
--- /dev/null
+++ b/spec/javascripts/extensions/array_spec.js.coffee
@@ -0,0 +1,12 @@
+#= require extensions/array
+
+describe 'Array extensions', ->
+ describe 'first', ->
+ it 'returns the first item', ->
+ arr = [0, 1, 2, 3, 4, 5]
+ expect(arr.first()).toBe(0)
+
+ describe 'last', ->
+ it 'returns the last item', ->
+ arr = [0, 1, 2, 3, 4, 5]
+ expect(arr.last()).toBe(5)