File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
spec/generators/rspec/scaffold Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 101101
102102 describe 'namespaced request spec' do
103103 subject { file ( 'spec/requests/admin/posts_spec.rb' ) }
104- before { run_generator %w[ admin/posts ] }
105- it { is_expected . to exist }
106- it { is_expected . to contain ( /^RSpec.describe "\/ admin\/ posts", #{ type_metatag ( :request ) } / ) }
107- it { is_expected . to contain ( 'admin_post_url(post)' ) }
108- it { is_expected . to contain ( 'Admin::Post.create' ) }
104+
105+ describe 'with no options' do
106+ before { run_generator %w[ admin/posts ] }
107+ it { is_expected . to exist }
108+ it { is_expected . to contain ( /^RSpec.describe "\/ admin\/ posts", #{ type_metatag ( :request ) } / ) }
109+ it { is_expected . to contain ( 'post admin_posts_url, params: { admin_post: valid_attributes }' ) }
110+ it { is_expected . to contain ( 'admin_post_url(post)' ) }
111+ it { is_expected . to contain ( 'Admin::Post.create' ) }
112+ end
113+
114+ describe 'with --model-name' do
115+ before { run_generator %w[ admin/posts --model-name=post ] }
116+ it { is_expected . to contain ( 'post admin_posts_url, params: { post: valid_attributes }' ) }
117+ it { is_expected . not_to contain ( 'params: { admin_post: valid_attributes }' ) }
118+ it { is_expected . to contain ( ' Post.create' ) }
119+ end
109120 end
110121
111122 describe 'namespaced controller spec' do
You can’t perform that action at this time.
0 commit comments