head of your layout file, // like app/views/layouts/application.html.erb. <%= javascript_pack_tag 'hello_vue' %> <div data-v-2ed65b34="" id="app"> <p data-v-2ed65b34="">Hello Vue!</p> </div>
Capybara::Minitest::Assertions Capybara.register_driver :selenium do |app| Cappybara::Selenium::Driver.new app, browser: :chrome end Capybara.default_driver = :selenium end
ActionDispatch::IntegrationTest test "visiting the index" do visit welcome_index_url assert_selector "h1", text: "Welcome" end end $ rails test:integration #1 runs, 0 assertions, 0 fail…
Default: selenium driver e chrome browser • Não executa por default, use bin/rails test:system • ScreenshotHelper (tmp/screenshots/): take_screenshot e take_failed_screenshot
ApplicationSystemTestCase test "visiting the index" do visit welcome_index_url assert_selector "h1", text: "Welcome" end end # executando test de sistema $ rails test:system # 1 runs, 0 assertions, 0 failures
from: "[email protected]" def welcome(email) @email = email mail to: @email, subject: "Welcome to Example." end end $ bin/rails console > UserMailer.welcome("[email protected]").deliver_later
"posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 1000]] Post.limit(500).find_each.map(&:title) # => Post Load (0.2) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 500]] 5.0 5.1
- Yves Senn Ruby on Rails 5.1 Release Notes - Rails Rails 5.1.0.rc2: Loving JavaScript, System Tests, Encrypted Secrets, and more Ruby on Rails 5.1.0 Changes and New Features - Dave Kimura What’s new in Rails 5.1 - Mario Alberto Chávez