···321321end
322322323323namespace ICONS_URL do
324324- get "/icons/:domain/icon.png" do
325325- content_type "image/x-icon"
326326-327327- # TODO
324324+ get "/:domain/icon.png" do
325325+ # TODO: do this service ourselves
328326329329- ""
327327+ redirect "http://#{params[:domain]}/favicon.ico"
330328 end
331329end
+15
spec/icon_spec.rb
···11+require_relative "spec_helper.rb"
22+33+describe "icon module" do
44+ it "should fetch an icon" do
55+ get "/icons/example.com/icon.png"
66+77+ last_response.status.wont_equal 404
88+ end
99+1010+ it "should fetch an icon for a long domain" do
1111+ get "/icons/www.internal.corp.example.com/icon.png"
1212+1313+ last_response.status.wont_equal 404
1414+ end
1515+end