Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Changing scope in a mounted engine #6854

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+10 −0
Split
@@ -31,6 +31,7 @@ def self.routes
match "/polymorphic_path_for_engine", :to => "inside_engine_generating#polymorphic_path_for_engine"
match "/conflicting_url", :to => "inside_engine_generating#conflicting"
match "/foo", :to => "never#invoked", :as => :named_helper_that_should_be_invoked_only_in_respond_to_test
+ match "/link_to_another_scope", :to => "inside_engine_generating#link_to_another_scope", :as => :link_to_another_scope
end
routes
@@ -100,6 +101,10 @@ def polymorphic_path_for_engine
def conflicting
render :text => "engine"
end
+
+ def link_to_another_scope
+ render :text => url_for(:omg => "more-awesomeness", :only_path => true)
+ end
end
class ::OutsideEngineGeneratingController < ActionController::Base
@@ -188,6 +193,11 @@ def setup
assert_equal "engine", last_response.body
end
+ test "[ENGINE] link to another scope" do
+ get "/some-awesomeness/blog/link_to_another_scope"
+ assert_equal "/more-awesomeness/blog/link_to_another_scope", last_response.body
+ end
+
# Inside Application
test "[APP] generating engine's route includes prefix" do
get "/generate"