24 lines
780 B
Ruby
24 lines
780 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require "application_system_test_case"
|
||
|
|
||
|
class CharacterSheetTest < ApplicationSystemTestCase
|
||
|
test "can add and remove sections on a character sheet" do
|
||
|
system_sign_in users(:trevor)
|
||
|
|
||
|
character = characters(:nardren)
|
||
|
visit character_path(characters)
|
||
|
click_on I18n.t("characters.show.sheet")
|
||
|
assert_text character.name
|
||
|
|
||
|
click_link(I18n.t("character_sheet_sections.index.add_section"))
|
||
|
fill_in attr_name(CharacterSheetSection, :name), with: "Test Section"
|
||
|
click_button(I18n.t("character_sheet_sections.new.create_section"))
|
||
|
assert_text "Test Section"
|
||
|
|
||
|
click_link(I18n.t("character_sheet_sections.edit_links.delete_section", name: "Test Section"))
|
||
|
accept_confirm
|
||
|
assert_no_text "Test Section"
|
||
|
end
|
||
|
end
|