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:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-04-29 17:25:03 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2016-05-20 23:58:36 +0300
commite166a8022a3f239938a1449a0a8ce3485f309766 (patch)
treeaf9f612f599b01f5736e7b439f9579d77658f156 /spec/requests
parent56eb42007ae8c3c390b35bf336884b3bad3591c5 (diff)
Backend for a gitignores dropdown
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/gitignores_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/requests/api/gitignores_spec.rb b/spec/requests/api/gitignores_spec.rb
new file mode 100644
index 00000000000..d0e576e637c
--- /dev/null
+++ b/spec/requests/api/gitignores_spec.rb
@@ -0,0 +1,29 @@
+require 'spec_helper'
+
+describe API::Gitignores, api: true do
+ include ApiHelpers
+
+ describe 'Entity Gitignore' do
+ before { get api('/gitignores/Ruby') }
+
+ it { expect(json_response['name']).to eq('Ruby') }
+ it { expect(json_response['content']).to include('*.gem') }
+ end
+
+ describe 'Entity GitignoresList' do
+ before { get api('/gitignores') }
+
+ it { expect(json_response.first['name']).to be_truthy }
+ it { expect(json_response.first['content']).to be_falsey }
+ end
+
+ describe 'GET /gitignores' do
+ it 'returns a list of available license templates' do
+ get api('/gitignores')
+
+ expect(response.status).to eq(200)
+ expect(json_response).to be_an Array
+ expect(json_response.size).to be > 15
+ end
+ end
+end