File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,9 @@ module FeatureExampleGroup
1515 include app . routes . url_helpers if app . routes . respond_to? ( :url_helpers )
1616 include app . routes . mounted_helpers if app . routes . respond_to? ( :mounted_helpers )
1717
18- default_url_options [ :host ] ||= ::RSpec ::Rails ::FeatureExampleGroup ::DEFAULT_HOST
18+ if respond_to? ( :default_url_options )
19+ default_url_options [ :host ] ||= ::RSpec ::Rails ::FeatureExampleGroup ::DEFAULT_HOST
20+ end
1921 end
2022 end
2123
Original file line number Diff line number Diff line change @@ -18,6 +18,23 @@ module RSpec::Rails
1818 expect ( group . new . foo_url ) . to eq ( "http://www.example.com/foo" )
1919 end
2020
21+ context "when nested inside a request example group" do
22+ it "includes Rails route helpers" do
23+ Rails . application . routes . draw do
24+ get "/foo" , :as => :foo , :to => "foo#bar"
25+ end
26+
27+ group = RSpec ::Core ::ExampleGroup . describe do
28+ include RequestExampleGroup
29+ end . describe do
30+ include FeatureExampleGroup
31+ end
32+
33+ expect ( group . new . foo_path ) . to eq ( "/foo" )
34+ expect ( group . new . foo_url ) . to eq ( "http://www.example.com/foo" )
35+ end
36+ end
37+
2138 describe "#visit" do
2239 it "raises an error informing about missing Capybara" do
2340 group = RSpec ::Core ::ExampleGroup . describe do
You can’t perform that action at this time.
0 commit comments