sutty/test/controllers/api/v1/sites_controller_test.rb

33 lines
766 B
Ruby
Raw Normal View History

2019-09-05 18:56:24 +00:00
# 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