My application controller looks like:
class ApplicationController
before_action :set_customer
def customer?
@customer.nil?
end
private
def set_customer
if request.host != "example.com"
@customer = Customer.find_by_domain("...")
else
if request.subdomain != "www"
@customer = Customer.find_by_sub("...")
end
end
end
end
How can I make tests for the ApplicationController?
I want to pass in URLS and then check if @customer is nil etc.
e.g URLS to test
example.com
www.example.com
google.com
hello.example.com