Skip to content

Commit

Permalink
This patch removes deprecated catch-all routes from AM
Browse files Browse the repository at this point in the history
It also removes a monkey patch from AM::Base
  • Loading branch information
tenderlove committed Sep 24, 2018
1 parent 0a829f7 commit fefcb36
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions actionmailer/test/url_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ class WelcomeController < ActionController::Base

AppRoutes = ActionDispatch::Routing::RouteSet.new

class ActionMailer::Base
include AppRoutes.url_helpers
AppRoutes.draw do
get "/welcome" => "foo#bar", as: "welcome"
get "/dummy_model" => "foo#baz", as: "dummy_model"
get "/welcome/greeting", to: "welcome#greeting"
get "/a/b(/:id)", to: "a#b"
end

class UrlTestMailer < ActionMailer::Base
include AppRoutes.url_helpers

default_url_options[:host] = "www.basecamphq.com"

configure do |c|
Expand Down Expand Up @@ -80,14 +85,6 @@ def setup
def test_url_for
UrlTestMailer.delivery_method = :test

AppRoutes.draw do
ActiveSupport::Deprecation.silence do
get ":controller(/:action(/:id))"
get "/welcome" => "foo#bar", as: "welcome"
get "/dummy_model" => "foo#baz", as: "dummy_model"
end
end

# string
assert_url_for "http://foo/", "http://foo/"

Expand All @@ -111,13 +108,6 @@ def test_url_for
def test_signed_up_with_url
UrlTestMailer.delivery_method = :test

AppRoutes.draw do
ActiveSupport::Deprecation.silence do
get ":controller(/:action(/:id))"
get "/welcome" => "foo#bar", as: "welcome"
end
end

expected = new_mail
expected.to = @recipient
expected.subject = "[Signed up] Welcome #{@recipient}"
Expand Down

0 comments on commit fefcb36

Please sign in to comment.