|
2 | 2 |
|
3 | 3 | shared_examples "react_with_redux_generator" do |
4 | 4 | it "creates redux directories" do |
5 | | - %w[actions constants reducers store].each { |dir| assert_directory("app/javascript/bundles/HelloWorld/#{dir}") } |
| 5 | + assert_directory "app/javascript/src/HelloWorldApp/ror_components" |
| 6 | + %w[actions constants containers reducers store].each do |dir| |
| 7 | + assert_directory("app/javascript/src/HelloWorldApp/#{dir}") |
| 8 | + end |
6 | 9 | end |
7 | 10 |
|
8 | 11 | it "creates appropriate templates" do |
9 | | - assert_file("app/javascript/packs/hello-world-bundle.js") do |contents| |
10 | | - expect(contents).to match("import HelloWorld from '../bundles/HelloWorld/startup/HelloWorldApp.client';") |
11 | | - end |
12 | 12 | assert_file("app/views/hello_world/index.html.erb") do |contents| |
13 | | - expect(contents).to match(/"HelloWorld"/) |
| 13 | + expect(contents).to match(/"HelloWorldApp"/) |
14 | 14 | end |
15 | 15 | end |
16 | 16 |
|
17 | 17 | it "copies base redux files" do |
18 | | - %w[app/javascript/bundles/HelloWorld/actions/helloWorldActionCreators.js |
19 | | - app/javascript/bundles/HelloWorld/containers/HelloWorldContainer.js |
20 | | - app/javascript/bundles/HelloWorld/constants/helloWorldConstants.js |
21 | | - app/javascript/bundles/HelloWorld/reducers/helloWorldReducer.js |
22 | | - app/javascript/bundles/HelloWorld/store/helloWorldStore.js |
23 | | - app/javascript/bundles/HelloWorld/startup/HelloWorldApp.client.jsx |
24 | | - app/javascript/bundles/HelloWorld/startup/HelloWorldApp.server.jsx].each { |file| assert_file(file) } |
| 18 | + %w[app/javascript/src/HelloWorldApp/actions/helloWorldActionCreators.js |
| 19 | + app/javascript/src/HelloWorldApp/containers/HelloWorldContainer.js |
| 20 | + app/javascript/src/HelloWorldApp/constants/helloWorldConstants.js |
| 21 | + app/javascript/src/HelloWorldApp/reducers/helloWorldReducer.js |
| 22 | + app/javascript/src/HelloWorldApp/store/helloWorldStore.js |
| 23 | + app/javascript/src/HelloWorldApp/ror_components/HelloWorldApp.client.jsx |
| 24 | + app/javascript/src/HelloWorldApp/ror_components/HelloWorldApp.server.jsx].each { |file| assert_file(file) } |
25 | 25 | end |
26 | 26 | end |
0 commit comments