diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-04-29 16:25:03 +0200 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-05-20 15:58:36 -0500 |
commit | e166a8022a3f239938a1449a0a8ce3485f309766 (patch) | |
tree | af9f612f599b01f5736e7b439f9579d77658f156 /spec/requests | |
parent | 56eb42007ae8c3c390b35bf336884b3bad3591c5 (diff) | |
download | gitlab-ce-e166a8022a3f239938a1449a0a8ce3485f309766.tar.gz |
Backend for a gitignores dropdown
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/gitignores_spec.rb | 29 |
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 |