File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
spec/generators/rspec/scaffold Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 118118 it { is_expected . to contain ( ' Post.create' ) }
119119 end
120120
121- describe 'with --model-name & --api' do
122- before { run_generator %w[ admin/posts --api --model-name=post ] }
123- it { is_expected . to contain ( 'params: { post: valid_attributes }' ) }
124- it { is_expected . not_to contain ( 'params: { admin_post: valid_attributes }' ) }
121+ context 'with --api' do
122+ describe 'with default options' do
123+ before { run_generator %w[ admin/posts --api ] }
124+ it { is_expected . to contain ( 'params: { admin_post: valid_attributes }' ) }
125+ it { is_expected . to contain ( 'Admin::Post.create' ) }
126+ end
127+
128+ describe 'with --model-name' do
129+ before { run_generator %w[ admin/posts --api --model-name=post ] }
130+ it { is_expected . to contain ( 'params: { post: valid_attributes }' ) }
131+ it { is_expected . not_to contain ( 'params: { admin_post: valid_attributes }' ) }
132+ it { is_expected . to contain ( ' Post.create' ) }
133+ end
125134 end
126135 end
127136
You can’t perform that action at this time.
0 commit comments