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