1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00
Maybe/test/system/settings_test.rb
2024-08-27 17:10:31 -04:00

38 lines
960 B
Ruby

require "application_system_test_case"
class SettingsTest < ApplicationSystemTestCase
setup do
sign_in @user = users(:family_admin)
@settings_links = [
[ "Account", settings_profile_path ],
[ "Preferences", settings_preferences_path ],
[ "Accounts", accounts_path ],
[ "Tags", tags_path ],
[ "Categories", categories_path ],
[ "Merchants", merchants_path ],
[ "Imports", imports_path ],
[ "What's new", changelog_path ],
[ "Feedback", feedback_path ]
]
end
test "can access settings from sidebar" do
open_settings_from_sidebar
assert_selector "h1", text: "Account"
assert_current_path settings_profile_path
@settings_links.each do |name, path|
click_link name
assert_selector "h1", text: name
assert_current_path path
end
end
private
def open_settings_from_sidebar
find("#user-menu").click
click_link "Settings"
end
end