Skip to content

Commit

Permalink
integration coverage to make sure the README gets printed to standard…
Browse files Browse the repository at this point in the history
… out when running install generator
  • Loading branch information
Dan Croak committed Feb 13, 2011
1 parent 29d862e commit 342a930
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion features/integration.feature
Expand Up @@ -23,7 +23,8 @@ Feature: integrate with application

Scenario: generate a Rails app, run the generators, and run the tests
When I successfully run "rails generate clearance:install"
And I successfully run "rake db:migrate --trace"
Then the output should contain "Next steps"
When I successfully run "rake db:migrate --trace"
And I successfully run "rake --trace"
Then the output should contain "passed"
And the output should not contain "failed"
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/clearance/install/install_generator.rb
Expand Up @@ -24,6 +24,8 @@ def install
else
template "test/factories.rb", "test/factories/clearance.rb"
end

readme "README"
end

private
Expand Down
18 changes: 8 additions & 10 deletions lib/generators/clearance/install/templates/README
@@ -1,24 +1,22 @@

*******************************************************************************

Next:
Next steps:

1. Configure default url options for the mailer to generate URLs in emails.
In production.rb it must be the actual host your application is deployed to.
In config/environments/test.rb and config/environments/development.rb:
1. Configure the mailer to create full URLs in emails:

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

In production it should be your app's domain name.

2. Migrate:

rake db:migrate

3. Make sure you're displaying flashes somewhere. For instance, in a layout:
3. Display flashes. For example, in your application layout:

<div id="flash">
<% flash.each do |key, value| -%>
<div id="flash_<%= key %>"><%=h value %></div>
<% end -%>
</div>
<% flash.each do |key, value| -%>
<div class="flash <%= key %>"><%=h value %></div>
<% end -%>

*******************************************************************************

0 comments on commit 342a930

Please sign in to comment.