Module: Booth::Testing::Shortcuts
- Extended by:
- ActiveSupport::Concern
- Included in:
- IncorporationTestCase
- Defined in:
- lib/booth/testing/shortcuts.rb
Overview
Shortcuts and Assertions for System tests.
Instance Method Summary collapse
- #assert_logged_in(credential: Dry::Initializer::UNDEFINED, username: Dry::Initializer::UNDEFINED) ⇒ Object
- #assert_logged_out ⇒ Object
- #assert_userland_view(controller:, step:) ⇒ Object
- #create_and_onboard(username:) ⇒ Object
- #login_with_passkey(username:) ⇒ Object
- #register_new_passkey(username:) ⇒ Object
- #soft_reset_session ⇒ Object
- #virtual_authenticators ⇒ Object
- #visit_namespaced(controller:, action:, params: {}) ⇒ Object
Instance Method Details
#assert_logged_in(credential: Dry::Initializer::UNDEFINED, username: Dry::Initializer::UNDEFINED) ⇒ Object
40 41 42 |
# File 'lib/booth/testing/shortcuts.rb', line 40 def assert_logged_in(credential: Dry::Initializer::UNDEFINED, username: Dry::Initializer::UNDEFINED) ::Booth::Testing::Support::AssertLoggedIn.call(scope:, credential:, username:) end |
#assert_logged_out ⇒ Object
36 37 38 |
# File 'lib/booth/testing/shortcuts.rb', line 36 def assert_logged_out ::Booth::Testing::Support::AssertLoggedOut.call(scope:) end |
#assert_userland_view(controller:, step:) ⇒ Object
44 45 46 |
# File 'lib/booth/testing/shortcuts.rb', line 44 def assert_userland_view(controller:, step:) ::Booth::Testing::Support::AssertPartial.call(namespace: :userland, controller:, step:) end |
#create_and_onboard(username:) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/booth/testing/shortcuts.rb', line 17 def create_and_onboard(username:) ::Booth::Testing::Support::Shortcuts::CreateAndOnboard.call(routing_namespace:, scope:, username:, after_credential:) end |
#login_with_passkey(username:) ⇒ Object
30 31 32 33 34 |
# File 'lib/booth/testing/shortcuts.rb', line 30 def login_with_passkey(username:) ::Booth::Testing::Support::Shortcuts::LoginWithPasskey.call(routing_namespace:, scope:, username:) end |
#register_new_passkey(username:) ⇒ Object
24 25 26 27 28 |
# File 'lib/booth/testing/shortcuts.rb', line 24 def register_new_passkey(username:) ::Booth::Testing::Support::Shortcuts::RegisterNewPasskey.call(routing_namespace:, scope:, username:) end |
#soft_reset_session ⇒ Object
48 49 50 |
# File 'lib/booth/testing/shortcuts.rb', line 48 def soft_reset_session ::Booth::Testing::Support::SoftResetSession.call end |
#virtual_authenticators ⇒ Object
52 53 54 |
# File 'lib/booth/testing/shortcuts.rb', line 52 def virtual_authenticators @virtual_authenticators ||= ::Booth::Testing::Support::VirtualAuthenticators::Manager.new end |
#visit_namespaced(controller:, action:, params: {}) ⇒ Object
13 14 15 |
# File 'lib/booth/testing/shortcuts.rb', line 13 def visit_namespaced(controller:, action:, params: {}) ::Booth::Testing::Support::Visit.call(routing_namespace:, controller:, action:, params:) end |