-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
routes specs #10
Comments
You're right there is no documentation for this because I've never tried it before :) You can get it to work if you write a spec like:
That first before block is really ugly though! Ammeter should hide that ugliness and I need to think about what the block should look like. Rails with TestUnit does this with
WDYT? |
I was actually making a pull request, and based the solution on the routes test from devise. Looking closer, devise actually implements its own copy_routes, and that is what I did. def copy_routes
routes = File.expand_path("../../dummy/config/routes.rb", __FILE__)
destination = File.join(destination_root, "config")
FileUtils.mkdir_p(destination)
FileUtils.cp routes, destination
end
describe RailsOauthProvider::Generators::InstallGenerator do
# Tell the generator where to put its output (what it thinks of as Rails.root)
destination File.expand_path("../../../tmp", __FILE__)
before do
prepare_destination
copy_routes
end
describe 'no arguments' do
#Test implementation
end
end It is up to you to if you want to leave this as is and be a 1 to 1 representation of the Rails::Generators::TestCase, or to choose to break from the interface and enhance it. I don't mind doing a pull request with the contents and test of my comment, just let me know what direction you want it implemented. BTW, thanks for the gem. It looks pretty good. |
Yes it would be great if you want to do a pull request. Let's stick with Glad you find this useful. I'm looking forward to your fix. |
I tried to test the route method of generator and it doesn't work.
Maybe I missed the documentation entry but I couldn't find.
The text was updated successfully, but these errors were encountered: