mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Request success field to boolean, test improvement
This commit is contained in:
parent
9e5e8ea100
commit
53b6734395
3 changed files with 28 additions and 4 deletions
|
@ -21,7 +21,7 @@ ActiveRecord::Schema.define(version: 0) do
|
|||
t.text "response"
|
||||
t.string "request_command"
|
||||
t.string "request_object"
|
||||
t.string "request_successful"
|
||||
t.boolean "request_successful"
|
||||
t.string "api_user_name"
|
||||
t.string "api_user_registrar"
|
||||
t.datetime "created_at"
|
||||
|
@ -33,7 +33,7 @@ ActiveRecord::Schema.define(version: 0) do
|
|||
t.text "response"
|
||||
t.string "request_command"
|
||||
t.string "request_object"
|
||||
t.string "request_successful"
|
||||
t.boolean "request_successful"
|
||||
t.string "api_user_name"
|
||||
t.string "api_user_registrar"
|
||||
t.datetime "created_at"
|
||||
|
|
|
@ -9,7 +9,7 @@ class CreateApiLogTables < ActiveRecord::Migration
|
|||
t.text :response
|
||||
t.string :request_command
|
||||
t.string :request_object
|
||||
t.string :request_successful
|
||||
t.boolean :request_successful
|
||||
t.string :api_user_name
|
||||
t.string :api_user_registrar
|
||||
|
||||
|
@ -21,7 +21,7 @@ class CreateApiLogTables < ActiveRecord::Migration
|
|||
t.text :response
|
||||
t.string :request_command
|
||||
t.string :request_object
|
||||
t.string :request_successful
|
||||
t.boolean :request_successful
|
||||
t.string :api_user_name
|
||||
t.string :api_user_registrar
|
||||
|
||||
|
|
|
@ -39,6 +39,30 @@ describe 'EPP Domain', epp: true do
|
|||
expect(response[:results][1][:value]).to eq('sh801333')
|
||||
|
||||
expect(response[:clTRID]).to eq('ABC-12345')
|
||||
|
||||
log = ApiLog::EppLog.all
|
||||
|
||||
expect(log.length).to eq(4)
|
||||
expect(log[0].request_command).to eq('hello')
|
||||
expect(log[0].request_successful).to eq(true)
|
||||
|
||||
expect(log[1].request_command).to eq('login')
|
||||
expect(log[1].request_successful).to eq(true)
|
||||
expect(log[1].api_user_name).to eq('zone')
|
||||
expect(log[1].api_user_registrar).to eq('Registrar OÜ')
|
||||
|
||||
expect(log[2].request_command).to eq('create')
|
||||
expect(log[2].request_object).to eq('domain')
|
||||
expect(log[2].request_successful).to eq(false)
|
||||
expect(log[2].api_user_name).to eq('zone')
|
||||
expect(log[2].api_user_registrar).to eq('Registrar OÜ')
|
||||
expect(log[2].request).not_to be_blank
|
||||
expect(log[2].response).not_to be_blank
|
||||
|
||||
expect(log[3].request_command).to eq('logout')
|
||||
expect(log[3].request_successful).to eq(true)
|
||||
expect(log[3].api_user_name).to eq('zone')
|
||||
expect(log[3].api_user_registrar).to eq('Registrar OÜ')
|
||||
end
|
||||
|
||||
it 'validates required parameters' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue