File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
lib/generators/rspec/feature
spec/generators/rspec/feature Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ def template_name
19
19
20
20
def filename
21
21
if options [ :singularize ]
22
- "#{ table_name . singularize } _spec.rb"
22
+ "#{ file_name . singularize } _spec.rb"
23
23
else
24
- "#{ table_name } _spec.rb"
24
+ "#{ file_name } _spec.rb"
25
25
end
26
26
end
27
27
end
Original file line number Diff line number Diff line change 24
24
end
25
25
end
26
26
27
+ describe 'are generated with the correct namespace' do
28
+ before do
29
+ run_generator %w( folder/posts )
30
+ end
31
+ describe 'the spec' do
32
+ subject ( :feature_spec ) { file ( 'spec/features/folder/posts_spec.rb' ) }
33
+ it "exists" do
34
+ expect ( feature_spec ) . to exist
35
+ end
36
+ it "contains the feature" do
37
+ expect ( feature_spec ) . to contain ( /^RSpec.feature \" Folder::Posts\" , #{ type_metatag ( :feature ) } / )
38
+ end
39
+ end
40
+ end
41
+
27
42
describe 'are singularized appropriately with the --singularize flag' do
28
43
before do
29
44
run_generator %w( posts --singularize )
You can’t perform that action at this time.
0 commit comments