From 50508da8f8a327fb8af50431216b45494f90731d Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Sun, 20 Apr 2025 18:25:16 -0700 Subject: [PATCH] Bot pass spec, policies, layout changes --- app/models/player.rb | 1 + app/policies/seat_policy.rb | 4 ++++ app/policies/table_policy.rb | 4 ++-- app/views/layouts/_navigation_links.html.erb | 2 +- app/views/layouts/application.html.erb | 6 +++--- app/views/visitors/index.html.haml | 8 ++++---- spec/features/bots/bot_play_spec.rb | 12 ++++++++++-- 7 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/models/player.rb b/app/models/player.rb index b2a69437..e34c5ee2 100644 --- a/app/models/player.rb +++ b/app/models/player.rb @@ -36,6 +36,7 @@ class Player < ActiveRecord::Base self.game.play_to_beat_id = nil end self.game.save + return "pass" end def runs diff --git a/app/policies/seat_policy.rb b/app/policies/seat_policy.rb index fc472aae..7d493cfd 100644 --- a/app/policies/seat_policy.rb +++ b/app/policies/seat_policy.rb @@ -30,6 +30,10 @@ class SeatPolicy true end + def stand? + true # TODO check that user is sitting here + end + def add_bot? true end diff --git a/app/policies/table_policy.rb b/app/policies/table_policy.rb index df18a02b..891f538c 100644 --- a/app/policies/table_policy.rb +++ b/app/policies/table_policy.rb @@ -7,7 +7,7 @@ class TablePolicy end def index? - @current_user.admin? + @current_user.admin? || true end def show? @@ -24,7 +24,7 @@ class TablePolicy end def play_now? - @current_user.admin? || @current_user.email == "bort@13.24x7.hk" + true end def new_game? diff --git a/app/views/layouts/_navigation_links.html.erb b/app/views/layouts/_navigation_links.html.erb index 59f01b65..413cc9ad 100644 --- a/app/views/layouts/_navigation_links.html.erb +++ b/app/views/layouts/_navigation_links.html.erb @@ -1,6 +1,6 @@