I just created a new app and I generated a test for it:
rails generate integration_test pages
The file was created and I just wrote a quick test for the home and root pages, they have not been created so the test should fail. This is the code for the tests:
require 'test_helper'
class PagesTest < ActionDispatch::IntegrationTest
test "should get home" do
get pages_home_url
assert_response :success
end
test "should get root" do
get root_url
assert_response :success
end
end
And then when I run
rails test
This is what I get
Run options: --seed 62495
Running:
/Users/marcelcarrero/rails_projects/recipesapp/myrecipes/db/schema.rb doesn't exist yet. Run
rails db:migrate
to create it, then try again. If you do not intend to use a database, you should instead alter /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/config/application.rb to limit the frameworks that will be loaded. /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/db/schema.rb doesn't exist yet. Runrails db:migrate
to create it, then try again. If you do not intend to use a database, you should instead alter /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/config/application.rb to limit the frameworks that will be loaded. /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/db/schema.rb doesn't exist yet. Runrails db:migrate
to create it, then try again. If you do not intend to use a database, you should instead alter /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/config/application.rb to limit the frameworks that will be loaded. /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/db/schema.rb doesn't exist yet. Runrails db:migrate
to create it, then try again. If you do not intend to use a database, you should instead alter /Users/marcelcarrero/rails_projects/recipesapp/myrecipes/config/application.rb to limit the frameworks that will be loaded.Finished in 0.060965s, 0.0000 runs/s, 0.0000 assertions/s. 0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
I am not sure what I am doing wrong here since the file was created on the right place, and if I make a change to it to create syntax error it gives me the error.
Aucun commentaire:
Enregistrer un commentaire