mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Merge branch 'master' into registry-661
# Conflicts: # db/structure.sql
This commit is contained in:
commit
18010c6a2e
42 changed files with 546 additions and 291 deletions
|
@ -1,5 +0,0 @@
|
|||
FactoryBot.define do
|
||||
factory :message do
|
||||
body 'fabricator body'
|
||||
end
|
||||
end
|
|
@ -1,47 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Message do
|
||||
context 'with invalid attribute' do
|
||||
before :all do
|
||||
@mssage = Message.new
|
||||
end
|
||||
|
||||
it 'should not be valid' do
|
||||
@mssage.valid?
|
||||
@mssage.errors.full_messages.should match_array([
|
||||
"Body is missing"
|
||||
])
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@mssage.versions.should == []
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
before :all do
|
||||
@mssage = create(:message)
|
||||
end
|
||||
|
||||
it 'should be valid' do
|
||||
@mssage.valid?
|
||||
@mssage.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should be valid twice' do
|
||||
@mssage = create(:message)
|
||||
@mssage.valid?
|
||||
@mssage.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@mssage.versions.should == []
|
||||
@mssage.body = 'New body'
|
||||
@mssage.save
|
||||
@mssage.errors.full_messages.should match_array([])
|
||||
@mssage.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,45 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'EPP domain:transfer' do
|
||||
let(:registrar) { create(:registrar) }
|
||||
let(:user) { create(:api_user_epp, registrar: registrar) }
|
||||
let(:session_id) { create(:epp_session, user: user).session_id }
|
||||
let(:request_xml) { <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
<command>
|
||||
<transfer op="request">
|
||||
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>test.com</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw>98oiewslkfkd</domain:pw>
|
||||
</domain:authInfo>
|
||||
</domain:transfer>
|
||||
</transfer>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
}
|
||||
|
||||
before :example do
|
||||
login_as user
|
||||
end
|
||||
|
||||
context 'when domain is not discarded' do
|
||||
let!(:domain) { create(:domain, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 1000' do
|
||||
post '/epp/command/transfer', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}"
|
||||
expect(response).to have_code_of(1000)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when domain is discarded' do
|
||||
let!(:domain) { create(:domain_discarded, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 2105' do
|
||||
post '/epp/command/transfer', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}"
|
||||
expect(response).to have_code_of(2105)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue