@@ -8,11 +8,16 @@ class WelcomeController < ActionController::Base
8
8
9
9
AppRoutes = ActionDispatch ::Routing ::RouteSet . new
10
10
11
- class ActionMailer ::Base
12
- include AppRoutes . url_helpers
11
+ AppRoutes . draw do
12
+ get "/welcome" => "foo#bar" , as : "welcome"
13
+ get "/dummy_model" => "foo#baz" , as : "dummy_model"
14
+ get "/welcome/greeting" , to : "welcome#greeting"
15
+ get "/a/b(/:id)" , to : "a#b"
13
16
end
14
17
15
18
class UrlTestMailer < ActionMailer ::Base
19
+ include AppRoutes . url_helpers
20
+
16
21
default_url_options [ :host ] = "www.basecamphq.com"
17
22
18
23
configure do |c |
@@ -80,14 +85,6 @@ def setup
80
85
def test_url_for
81
86
UrlTestMailer . delivery_method = :test
82
87
83
- AppRoutes . draw do
84
- ActiveSupport ::Deprecation . silence do
85
- get ":controller(/:action(/:id))"
86
- get "/welcome" => "foo#bar" , as : "welcome"
87
- get "/dummy_model" => "foo#baz" , as : "dummy_model"
88
- end
89
- end
90
-
91
88
# string
92
89
assert_url_for "http://foo/" , "http://foo/"
93
90
@@ -111,13 +108,6 @@ def test_url_for
111
108
def test_signed_up_with_url
112
109
UrlTestMailer . delivery_method = :test
113
110
114
- AppRoutes . draw do
115
- ActiveSupport ::Deprecation . silence do
116
- get ":controller(/:action(/:id))"
117
- get "/welcome" => "foo#bar" , as : "welcome"
118
- end
119
- end
120
-
121
111
expected = new_mail
122
112
expected . to = @recipient
123
113
expected . subject = "[Signed up] Welcome #{ @recipient } "
0 commit comments