mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 13:36:15 +02:00
Corrected integration tests
This commit is contained in:
parent
d150c1bc3d
commit
b86fac03b5
3 changed files with 4 additions and 3 deletions
|
@ -161,7 +161,7 @@ module Repp
|
||||||
|
|
||||||
def skip_webclient_user_cert_validation?
|
def skip_webclient_user_cert_validation?
|
||||||
!webclient_request? || request.headers['Requester'] == 'tara' ||
|
!webclient_request? || request.headers['Requester'] == 'tara' ||
|
||||||
Rails.env.development? || Rails.env.test?
|
Rails.env.development?
|
||||||
end
|
end
|
||||||
|
|
||||||
def auth_values_to_data(registrar:)
|
def auth_values_to_data(registrar:)
|
||||||
|
|
|
@ -19,6 +19,7 @@ end
|
||||||
class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase
|
class JavaScriptApplicationSystemTestCase < ApplicationSystemTestCase
|
||||||
self.use_transactional_tests = false
|
self.use_transactional_tests = false
|
||||||
DatabaseCleaner.strategy = :truncation
|
DatabaseCleaner.strategy = :truncation
|
||||||
|
Webdrivers::Chromedriver.required_version = '114.0.5735.90'
|
||||||
|
|
||||||
Capybara.register_driver(:chrome) do |app|
|
Capybara.register_driver(:chrome) do |app|
|
||||||
options = ::Selenium::WebDriver::Chrome::Options.new
|
options = ::Selenium::WebDriver::Chrome::Options.new
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ReppV1BaseTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal 'Invalid authorization information', response_json[:message]
|
assert_equal 'Invalid authorization information', response_json[:message]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_takes_ip_whitelist_into_account
|
def test_takes_ip_whitelist_into_account_if_api_request
|
||||||
Setting.api_ip_whitelist_enabled = true
|
Setting.api_ip_whitelist_enabled = true
|
||||||
Setting.registrar_ip_whitelist_enabled = true
|
Setting.registrar_ip_whitelist_enabled = true
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class ReppV1BaseTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
Repp::V1::BaseController.stub_any_instance(:webclient_request?, true) do
|
Repp::V1::BaseController.stub_any_instance(:webclient_request?, true) do
|
||||||
Repp::V1::BaseController.stub_any_instance(:validate_webclient_ca, true) do
|
Repp::V1::BaseController.stub_any_instance(:validate_webclient_ca, true) do
|
||||||
get repp_v1_contacts_path, headers: @auth_headers.merge!({ 'Request-IP' => whiteip.ipv4 })
|
get repp_v1_registrar_auth_index_path, headers: @auth_headers.merge!({ 'Request-IP' => whiteip.ipv4 })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue