diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 5fbbb5019..bca3cc0a1 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -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 diff --git a/spec/system/admin/admin_dashboard_presented_spec.rb b/spec/system/admin/admin_dashboard_presented_spec.rb new file mode 100644 index 000000000..e12dbd2c1 --- /dev/null +++ b/spec/system/admin/admin_dashboard_presented_spec.rb @@ -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