Skip to content

Commit 372b3db

Browse files
committed
fix: tests syntax for Ruby 2.7
1 parent ae2970b commit 372b3db

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/action_policy/behaviour_test.rb

+12-4
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ class AdminPolicy
341341

342342
authorize :user
343343

344-
def show? = user.name == "admin" || record != "admin"
344+
def show?
345+
user.name == "admin" || record != "admin"
346+
end
345347
end
346348

347349
class ChatPolicy < AdminPolicy
@@ -350,7 +352,9 @@ class ChatPolicy < AdminPolicy
350352

351353
authorize :user, :account
352354

353-
def speak? = user.name == account
355+
def speak?
356+
user.name == account
357+
end
354358
end
355359

356360
class ChatChannel
@@ -382,9 +386,13 @@ def account
382386
@account = @account ? @account.succ : "a"
383387
end
384388

385-
def implicit_authorization_target = self
389+
def implicit_authorization_target
390+
self
391+
end
386392

387-
def policy_class = ChatPolicy
393+
def policy_class
394+
ChatPolicy
395+
end
388396
end
389397

390398
class ChutChannel < ChatChannel

0 commit comments

Comments
 (0)