more tests, trying minitest

This commit is contained in:
2022-12-22 21:27:28 +02:00
parent b42d8137a9
commit 168320d6ee
6 changed files with 90 additions and 7 deletions

View File

@ -0,0 +1,28 @@
require "test_helper"
class CardsTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers # Rails >= 5
def go_edit
visit "/merged/sections/11"
find_link("View and Edit Cards").click
end
def test_edit_is
go_edit
assert_equal page.current_path , "/merged/sections/11/cards"
end
def test_update
go_edit
within("#card_6") do
find_button("Update" , match: :first).click
end
end
def _test_update
go_edit
within(".content_update") do
find_button("Update").click
end
end
end

View File

@ -1,7 +0,0 @@
require "test_helper"
class NavigationTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,36 @@
require "test_helper"
class SectionsTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers # Rails >= 5
def go_index
visit "/merged/pages"
click_on ("index")
end
def go_edit
go_index
within("#section_31") do
find_link("Edit").click
end
end
def test_edit_is
go_index
within("#section_31") do
assert has_link?("Edit")
end
end
def test_edit_ok
go_index
within("#section_31") do
find_link("Edit").click
end
end
def test_update
go_edit
within(".content_update") do
find_button("Update").click
end
end
end