mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Fix epp session test, now api_user honors active boolean correctly
This commit is contained in:
parent
061015e88a
commit
527bc2a0dc
4 changed files with 11 additions and 5 deletions
|
@ -20,7 +20,7 @@ class ApiUser < User
|
||||||
after_initialize :set_defaults
|
after_initialize :set_defaults
|
||||||
def set_defaults
|
def set_defaults
|
||||||
return unless new_record?
|
return unless new_record?
|
||||||
self.active = true
|
self.active = true unless active_changed?
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrar_typeahead
|
def registrar_typeahead
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ChangeApiUserDefaultValue < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
change_column_default :users, :active, nil
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150223104842) do
|
ActiveRecord::Schema.define(version: 20150227113121) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -640,19 +640,19 @@ ActiveRecord::Schema.define(version: 20150223104842) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
t.datetime "current_sign_in_at"
|
t.datetime "current_sign_in_at"
|
||||||
t.datetime "last_sign_in_at"
|
t.datetime "last_sign_in_at"
|
||||||
t.inet "current_sign_in_ip"
|
t.inet "current_sign_in_ip"
|
||||||
t.inet "last_sign_in_ip"
|
t.inet "last_sign_in_ip"
|
||||||
t.string "identity_code"
|
t.string "identity_code"
|
||||||
t.integer "country_id"
|
t.integer "country_id"
|
||||||
t.string "roles", array: true
|
t.string "roles", array: true
|
||||||
t.string "creator_str"
|
t.string "creator_str"
|
||||||
t.string "updator_str"
|
t.string "updator_str"
|
||||||
t.string "country_code"
|
t.string "country_code"
|
||||||
t.integer "registrar_id"
|
t.integer "registrar_id"
|
||||||
t.boolean "active", default: false
|
t.boolean "active"
|
||||||
t.text "csr"
|
t.text "csr"
|
||||||
t.text "crt"
|
t.text "crt"
|
||||||
t.string "type"
|
t.string "type"
|
||||||
|
|
|
@ -35,6 +35,7 @@ describe 'EPP Session', epp: true do
|
||||||
|
|
||||||
inactive = @epp_xml.session.login(clID: { value: 'inactive-user' }, pw: { value: 'ghyt9e4fu' })
|
inactive = @epp_xml.session.login(clID: { value: 'inactive-user' }, pw: { value: 'ghyt9e4fu' })
|
||||||
response = epp_plain_request(inactive, :xml)
|
response = epp_plain_request(inactive, :xml)
|
||||||
|
response[:msg].should == 'Authentication error; server closing connection'
|
||||||
response[:result_code].should == '2501'
|
response[:result_code].should == '2501'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue