Last active
November 26, 2024 04:49
-
-
Save MatheusRich/5f6dadd0fe70ea287a30158c2b67d3be to your computer and use it in GitHub Desktop.
Revisions
-
MatheusRich revised this gist
Apr 12, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ User.create!(name: "John", age: 30) visit users_path within_table "Users" do expect(page).to have_content "John" expect(page).to have_content "30" -
MatheusRich created this gist
Apr 12, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ require "rails_helper" RSpec.describe "User management", type: :request do # Runs in about 0.2 seconds (excluding file load time) it "lists existing users" do User.create!(name: "John", age: 30) get users_path expect(page).to have_table "Users" do |table| expect(table).to have_content "John" expect(table).to have_content "30" end end private def page = Capybara.string(response.body) end This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ require "rails_helper" RSpec.describe "User management", type: :system do before do driven_by(:selenium_chrome_headless) # driven_by(:cuprite) # uncomment this line to use Cuprite end # Runs in about 2.5 seconds with Selenium (excluding file load time) # Runs in about 1.5 seconds with Cuprite (excluding file load time) it "lists existing users" do User.create!(name: "John", age: 30) visit users_path within_table "Users" do expect(page).to have_content "John" expect(page).to have_content "30" end end end