Sha256: f4aa386e8cf46efc074269acc177fa94f2c790ba4ab0799d2de134e0505ac3e8
Contents?: true
Size: 1.96 KB
Versions: 9
Compression:
Stored size: 1.96 KB
Contents
# frozen_string_literal: true describe Crowdin::ApiResources::StringComments do describe 'Default endpoints' do describe '#list_string_comments' do it 'when request are valid', :default do stub_request(:get, "https://api.crowdin.com/#{target_api_url}/projects/#{project_id}/comments") list_string_comments = @crowdin.list_string_comments({}, project_id) expect(list_string_comments).to eq(200) end end describe '#add_string_comment' do it 'when request are valid', :default do stub_request(:post, "https://api.crowdin.com/#{target_api_url}/projects/#{project_id}/comments") add_string_comment = @crowdin.add_string_comment({}, project_id) expect(add_string_comment).to eq(200) end end describe '#get_string_comment' do let(:string_comment_id) { 1 } it 'when request are valid', :default do stub_request(:get, "https://api.crowdin.com/#{target_api_url}/projects/#{project_id}/comments/#{string_comment_id}") get_string_comment = @crowdin.get_string_comment(string_comment_id, project_id) expect(get_string_comment).to eq(200) end end describe '#delete_string_comment' do let(:string_comment_id) { 1 } it 'when request are valid', :default do stub_request(:delete, "https://api.crowdin.com/#{target_api_url}/projects/#{project_id}/comments/#{string_comment_id}") delete_string_comment = @crowdin.delete_string_comment(string_comment_id, project_id) expect(delete_string_comment).to eq(200) end end describe '#edit_string_comment' do let(:string_comment_id) { 1 } it 'when request are valid', :default do stub_request(:patch, "https://api.crowdin.com/#{target_api_url}/projects/#{project_id}/comments/#{string_comment_id}") edit_string_comment = @crowdin.edit_string_comment(string_comment_id, {}, project_id) expect(edit_string_comment).to eq(200) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems