fix pending specs

This commit is contained in:
Georg Gadinger 2022-06-21 21:33:46 +02:00
parent b3c7faba03
commit ecec7617dd
2 changed files with 19 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# frozen_string_literal: true
require "rails_helper"
require "support/pghero_stubby"
describe "role-constrained routes", type: :request do
shared_examples_for "fails to access route" do
@ -46,6 +47,6 @@ describe "role-constrained routes", type: :request do
it_behaves_like("routes for", [:administrator], -> { get("/justask_admin") })
it_behaves_like("routes for", [:administrator], -> { get("/sidekiq") })
it_behaves_like("routes for", [:administrator], -> { get("/pghero") }), skip_reason: "PG::InFailedSqlTransaction due to 5.1 upgrade, works fine outside specs though")
it_behaves_like("routes for", [:administrator], -> { get("/pghero") })
it_behaves_like("routes for", %i[administrator moderator], -> { get("/moderation") })
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
# in spec/integration/role_constrained_routes_spec.rb we test for access to
# the pghero route, which fails because the PgHero::HomeController performs
# some queries which do not seem to work in a transaction
#
# since we don't need PgHero to work in tests stubbing it away should be^W^W
# is expected to be fine ;-)
class PgHero::HomeController
def index
render plain: "DB < ÖBB"
end
def set_database; end
def set_query_stats_enabled; end
def set_show_details; end
end