Skip to content

Commit 22bdfff

Browse files
drwlpirj
authored andcommitted
Add spec for including engine routes
1 parent 8e55910 commit 22bdfff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/generators/rspec/scaffold/scaffold_generator_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@
3939
it { is_expected.to contain('renders a JSON response with the post') }
4040
it { is_expected.to contain('renders a JSON response with errors for the post') }
4141
end
42+
43+
describe 'in an engine' do
44+
before do
45+
allow_any_instance_of(::Rails::Generators::NamedBase).to receive(:mountable_engine?).and_return(true)
46+
run_generator %w[posts --request_specs]
47+
end
48+
49+
it { is_expected.to contain('Engine.routes.url_helpers') }
50+
end
4251
end
4352

4453
describe 'standard controller spec' do

0 commit comments

Comments
 (0)