Basic REPP doc

This commit is contained in:
Martin Lensment 2015-03-18 11:06:52 +02:00
parent 30147db127
commit dcf64bf5df
7 changed files with 165 additions and 6 deletions

View file

@ -6,12 +6,12 @@ describe Repp::ContactV1 do
@api_user = Fabricate(:gitlab_api_user)
end
describe 'GET /repp/v1/contacts' do
describe 'GET /repp/v1/contacts', autodoc: true do
it 'returns contacts of the current registrar' do
Fabricate.times(2, :contact, registrar: @api_user.registrar)
Fabricate.times(2, :contact)
get_with_auth '/repp/v1/contacts', {}, @api_user
get_with_auth '/repp/v1/contacts', { page: 1 }, @api_user
expect(response.status).to eq(200)
body = JSON.parse(response.body)
@ -23,7 +23,7 @@ describe Repp::ContactV1 do
log = ApiLog::ReppLog.first
expect(log[:request_path]).to eq('/repp/v1/contacts')
expect(log[:request_method]).to eq('GET')
expect(log[:request_params]).to eq('{}')
expect(log[:request_params]).to eq('{"page":"1"}')
expect(log[:response].length).to be > 20
expect(log[:response_code]).to eq('200')
expect(log[:api_user_name]).to eq('gitlab')

View file

@ -7,11 +7,11 @@ describe Repp::DomainV1 do
@api_user = Fabricate(:gitlab_api_user, registrar: @registrar1)
end
describe 'GET /repp/v1/domains' do
describe 'GET /repp/v1/domains', autodoc: true do
it 'returns domains of the current registrar' do
Fabricate.times(2, :domain, registrar: @api_user.registrar)
get_with_auth '/repp/v1/domains', {}, @api_user
get_with_auth '/repp/v1/domains', { page: 1 }, @api_user
response.status.should == 200
body = JSON.parse(response.body)
@ -23,7 +23,7 @@ describe Repp::DomainV1 do
log = ApiLog::ReppLog.last
log[:request_path].should == '/repp/v1/domains'
log[:request_method].should == 'GET'
log[:request_params].should == '{}'
log[:request_params].should == '{"page":"1"}'
log[:response_code].should == '200'
log[:api_user_name].should == 'gitlab'
log[:api_user_registrar].should == 'registrar1'