Skip to content

Commit 3b12614

Browse files
authored
Add only_path param to system test helpers (#197)
1 parent 0428330 commit 3b12614

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/passwordless/test_helpers.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,22 @@ def passwordless_sign_in(resource)
4343
end
4444

4545
module SystemTestCase
46-
def passwordless_sign_out(cls = nil)
46+
def passwordless_sign_out(cls = nil, only_path: false)
4747
cls ||= "User".constantize
4848
resource = cls.model_name.to_s.tableize
4949

50-
visit(Passwordless.context.url_for(resource, action: "destroy"))
50+
visit(Passwordless.context.url_for(resource, action: "destroy", only_path: only_path))
5151
end
5252

53-
def passwordless_sign_in(resource)
53+
def passwordless_sign_in(resource, only_path: false)
5454
session = Passwordless::Session.create!(authenticatable: resource)
5555

5656
magic_link = Passwordless.context.url_for(
5757
session,
5858
action: "confirm",
5959
id: session.to_param,
60-
token: session.token
60+
token: session.token,
61+
only_path: only_path
6162
)
6263

6364
visit(magic_link)

0 commit comments

Comments
 (0)