33 lines
766 B
Ruby
33 lines
766 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'test_helper'
|
||
|
|
||
|
module Api
|
||
|
module V1
|
||
|
class SitesControllerTest < ActionDispatch::IntegrationTest
|
||
|
setup do
|
||
|
@rol = create :rol
|
||
|
@site = @rol.site
|
||
|
@usuarie = @rol.usuarie
|
||
|
|
||
|
@authorization = {
|
||
|
Authorization: ActionController::HttpAuthentication::Basic
|
||
|
.encode_credentials(@usuarie.email, @usuarie.password)
|
||
|
}
|
||
|
end
|
||
|
|
||
|
teardown do
|
||
|
@site.destroy
|
||
|
end
|
||
|
|
||
|
test 'se puede generar un certificado' do
|
||
|
get v1_sites_allowed_url, params: { domain: @site.name }
|
||
|
assert_response :ok
|
||
|
|
||
|
get v1_sites_allowed_url, params: { domain: SecureRandom.hex }
|
||
|
assert_response :not_found
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|