mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Add first test for REPP
This commit is contained in:
parent
4af3e80087
commit
6de072b849
3 changed files with 58 additions and 3 deletions
22
spec/requests/domain_v1_spec.rb
Normal file
22
spec/requests/domain_v1_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Repp::DomainV1 do
|
||||
let(:epp_user) { Fabricate(:epp_user) }
|
||||
|
||||
before(:each) { create_settings }
|
||||
|
||||
describe 'GET /repp/v1/domains' do
|
||||
it 'returns domains of the current registrar' do
|
||||
Fabricate.times(2, :domain, registrar: epp_user.registrar)
|
||||
|
||||
get_with_auth '/repp/v1/domains', {}, epp_user
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
body = JSON.parse(response.body)
|
||||
expect(body['total_pages']).to eq(1)
|
||||
|
||||
# TODO: Maybe there is a way not to convert from and to json again
|
||||
expect(body['domains'].to_json).to eq(epp_user.registrar.domains.to_json)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue