Adds administrate gem CSS & JS assets to Sprockets Manifest (#6291) [deploy]
* Adds administrate gem application.css & applicatiion.js to Sprockets manifest * Adds admin tests
This commit is contained in:
parent
6d4925a17d
commit
5bb9890c09
2 changed files with 25 additions and 0 deletions
|
|
@ -4,3 +4,5 @@
|
|||
//= link_directory ../stylesheets .css
|
||||
//= link internal/layout.css
|
||||
//= link s3_direct_upload.js
|
||||
// = link administrate/application.css
|
||||
// = link administrate/application.js
|
||||
|
|
|
|||
23
spec/system/admin/admin_dashboard_presented_spec.rb
Normal file
23
spec/system/admin/admin_dashboard_presented_spec.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
require "rails_helper"
|
||||
|
||||
RSpec.describe "Admin dashboard is presented", type: :system do
|
||||
let(:admin) { create(:user, :super_admin) }
|
||||
let(:user) { create(:user) }
|
||||
|
||||
before { Bullet.raise = false }
|
||||
after { Bullet.raise = true }
|
||||
|
||||
it "loads the admin dashboard view" do
|
||||
sign_in admin
|
||||
visit "/admin"
|
||||
expect(page).to have_content("Articles")
|
||||
|
||||
visit "/admin/podcasts"
|
||||
expect(page).to have_content("Podcast Episodes")
|
||||
end
|
||||
|
||||
it "fails to load admin view for unauthorized users" do
|
||||
expect { visit "/admin" }.to raise_error(Pundit::NotAuthorizedError)
|
||||
expect { visit "/admin/podcasts" }.to raise_error(Pundit::NotAuthorizedError)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue