mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 03:32:18 -05:00
20 lines
541 B
Ruby
20 lines
541 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "Admin::Problems" do
|
|
it "is inaccessible to anything less than admin", :as_editor do
|
|
get "/admin/problems"
|
|
expect(response).to have_http_status(:unauthorized)
|
|
end
|
|
|
|
context "with admin permission", :as_administrator do
|
|
it "is accessible" do
|
|
get "/admin/problems"
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
|
|
it "is inaccessible in demo mode", :demo_mode do
|
|
expect { get("/admin/problems") }.to raise_error(Pundit::NotAuthorizedError)
|
|
end
|
|
end
|
|
end
|