-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ammeter instead of aruba to test generators
* Tests are much faster * Failures are improved * Don't generate a Rails app inside each test * Don't boot up Rails several times
- Loading branch information
Showing
4 changed files
with
42 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'spec_helper' | ||
require 'generators/effigy/view/view_generator' | ||
|
||
describe Effigy::Generators::ViewGenerator do | ||
destination File.join(PROJECT_ROOT, 'tmp') | ||
before { prepare_destination } | ||
|
||
it 'generates an action view and template with the given name' do | ||
run_generator %w(users create) | ||
|
||
view = file('app/views/users/create.html.effigy') | ||
view.should exist | ||
view.should contain('class UsersCreateView < Effigy::Rails::View') | ||
view.should contain('app/templates/users/create.html') | ||
|
||
template = file('app/templates/users/create.html') | ||
template.should exist | ||
template.should contain('UsersCreateView') | ||
template.should contain('Edit me at app/templates/users/create.html') | ||
template. | ||
should contain('Edit my view at app/views/users/create.html.effigy') | ||
end | ||
|
||
it 'generates a layout view and template' do | ||
run_generator %w(layouts narrow) | ||
|
||
view = file('app/views/layouts/narrow.html.effigy') | ||
view.should exist | ||
view.should contain('class NarrowLayout < Effigy::Rails::View') | ||
view.should contain('app/templates/layouts/narrow.html') | ||
|
||
template = file('app/templates/layouts/narrow.html') | ||
template.should exist | ||
template.should contain('NarrowLayout') | ||
template.should contain('Edit me at app/templates/layouts/narrow.html') | ||
template. | ||
should contain('Edit my view at app/views/layouts/narrow.html.effigy') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters