Skip to content

Commit

Permalink
Update Base Generator Helpful Message
Browse files Browse the repository at this point in the history
- Add info for hot reloading server npm cmd.
- Remove duplicate code from redux generator
  helpful msg because base now prints the same msg.
- Update tests to reflect changes.
  • Loading branch information
aaronvb committed Feb 16, 2016
1 parent f2585e3 commit ed698ad
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
6 changes: 6 additions & 0 deletions lib/generators/react_on_rails/base_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ def print_helpful_message
npm run rails-server
- Visit http://localhost:3000/hello_world and see your React On Rails app running!
- Run the npm express-server command to load the node server with hot reloading support.
npm run express-server
- Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server.
MSG
GeneratorMessages.add_info(message)
end
Expand Down
11 changes: 0 additions & 11 deletions lib/generators/react_on_rails/react_with_redux_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ def template_appropriate_version_of_hello_world_app_client
location = "client/app/bundles/HelloWorld/startup"
template("redux/base/#{location}/HelloWorldAppClient.jsx.tt", "#{location}/#{filename}")
end

def print_helpful_message
message = <<-MSG
- Run the npm express-server command to load the node server with hot reloading support.
npm run express-server
- Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server.
MSG
GeneratorMessages.add_info(message)
end
end
end
end
27 changes: 23 additions & 4 deletions spec/react_on_rails/generators/install_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,38 @@
npm run rails-server
- Visit http://localhost:3000/hello_world and see your React On Rails app running!
- Run the npm express-server command to load the node server with hot reloading support.
npm run express-server
- Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server.
MSG
expect(GeneratorMessages.output)
.to include(GeneratorMessages.format_info(expected))
end

specify "react with redux generator contains a helpful message" do
run_generator_test_with_args(%w(--redux))
expected = <<-MSG
- Run the npm express-server command to load the node server with hot reloading support.
expected = <<-MSG.strip_heredoc
What to do next:
- Ensure your bundle and npm are up to date.
bundle && npm i
- Run the npm rails-server command to load the rails server.
npm run rails-server
- Visit http://localhost:3000/hello_world and see your React On Rails app running!
- Run the npm express-server command to load the node server with hot reloading support.
npm run express-server
npm run express-server
- Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server.
- Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server.
MSG
expect(GeneratorMessages.output)
.to include(GeneratorMessages.format_info(expected))
Expand Down

0 comments on commit ed698ad

Please sign in to comment.