BigW Consortium Gitlab

gitignores_spec.rb 759 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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') }

16 17
    it { expect(json_response.first['name']).not_to be_nil }
    it { expect(json_response.first['content']).to be_nil }
18 19 20 21 22 23 24 25 26 27 28 29
  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