Sha256: 3b57adad71f76d4efca8d4c5b3e05b49ed0ac7225c7405aeadd1dbd5d7a7887d

Contents?: true

Size: 1.69 KB

Versions: 10

Compression:

Stored size: 1.69 KB

Contents

# frozen_string_literal: true

describe Crowdin::ApiResources::Languages do
  describe 'Default endpoints' do
    describe '#list_languages' do
      it 'when request are valid', :default do
        stub_request(:get, "https://api.crowdin.com/#{target_api_url}/languages")
        list_languages = @crowdin.list_languages
        expect(list_languages).to eq(200)
      end
    end

    describe '#add_custom_language' do
      it 'when request are valid', :default do
        stub_request(:post, "https://api.crowdin.com/#{target_api_url}/languages")
        add_custom_language = @crowdin.add_custom_language
        expect(add_custom_language).to eq(200)
      end
    end

    describe '#get_language' do
      let(:language_id) { 1 }

      it 'when request are valid', :default do
        stub_request(:get, "https://api.crowdin.com/#{target_api_url}/languages/#{language_id}")
        get_language = @crowdin.get_language(language_id)
        expect(get_language).to eq(200)
      end
    end

    describe '#delete_custom_language' do
      let(:language_id) { 1 }

      it 'when request are valid', :default do
        stub_request(:delete, "https://api.crowdin.com/#{target_api_url}/languages/#{language_id}")
        delete_custom_language = @crowdin.delete_custom_language(language_id)
        expect(delete_custom_language).to eq(200)
      end
    end

    describe '#edit_custom_language' do
      let(:language_id) { 1 }

      it 'when request are valid', :default do
        stub_request(:patch, "https://api.crowdin.com/#{target_api_url}/languages/#{language_id}")
        edit_custom_language = @crowdin.edit_custom_language(language_id)
        expect(edit_custom_language).to eq(200)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
crowdin-api-1.12.0 spec/api_resources/languages_spec.rb
crowdin-api-1.10.0 spec/api_resources/languages_spec.rb
crowdin-api-1.9.0 spec/api_resources/languages_spec.rb
crowdin-api-1.8.1 spec/api_resources/languages_spec.rb
crowdin-api-1.8.0 spec/api_resources/languages_spec.rb
crowdin-api-1.7.0 spec/api_resources/languages_spec.rb
crowdin-api-1.6.0 spec/api_resources/languages_spec.rb
crowdin-api-1.5.0 spec/api_resources/languages_spec.rb
crowdin-api-1.4.0 spec/api_resources/languages_spec.rb
crowdin-api-1.3.0 spec/api_resources/languages_spec.rb