summaryrefslogtreecommitdiff
path: root/spec/requests/api/gitignores_spec.rb
blob: d0e576e637c9cf591e987fbd8c4a011dc94f2391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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