Permalink
Browse files

Add failing test for index.js with single quotes

  • Loading branch information...
Spone authored and florentferry committed Jun 13, 2018
1 parent 6887186 commit e4fad3a9ea185b33aae159dd0b189f81c68395bf
Showing with 32 additions and 0 deletions.
  1. +32 −0 features/component_generator.feature
@@ -65,6 +65,38 @@ Feature: Component generator
import "components/button/button";
"""
Scenario: `imports` in JavaScript files support single quotes
When I cd to "frontend/components"
And a file named "index.js" with:
"""
import 'components/all/all';
import 'components/bar/bar';
import 'components/foo_bar/foo_bar';
import 'components/namespaced';
import 'components/required/required';
import 'components/world/world';
"""
Then the file named "index.js" should contain:
"""
import 'components/all/all';
import 'components/bar/bar';
import 'components/foo_bar/foo_bar';
import 'components/namespaced';
import 'components/required/required';
import 'components/world/world';
"""
When I run `rails generate component button`
Then the file named "index.js" should contain:
"""
import "components/button/button";
import 'components/all/all';
import 'components/bar/bar';
import 'components/foo_bar/foo_bar';
import 'components/namespaced';
import 'components/required/required';
import 'components/world/world';
"""
Scenario: `imports` in JavaScript files are sorted and without duplicates
When I cd to "frontend/components"
When I run `rails generate component some_example`

0 comments on commit e4fad3a

Please sign in to comment.