more tests, trying minitest
This commit is contained in:
28
test/integration/cards_test.rb
Normal file
28
test/integration/cards_test.rb
Normal 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
|
@ -1,7 +0,0 @@
|
||||
require "test_helper"
|
||||
|
||||
class NavigationTest < ActionDispatch::IntegrationTest
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
36
test/integration/sections_test.rb
Normal file
36
test/integration/sections_test.rb
Normal 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
|
Reference in New Issue
Block a user