2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe Admin::PluginsController do
|
2015-02-11 00:18:16 +08:00
|
|
|
|
2022-10-31 20:02:26 +08:00
|
|
|
it "is a subclass of StaffController" do
|
|
|
|
expect(Admin::PluginsController < Admin::StaffController).to eq(true)
|
2015-02-11 00:18:16 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
context "while logged in as an admin" do
|
2018-06-11 12:33:07 +08:00
|
|
|
before do
|
|
|
|
sign_in(Fabricate(:admin))
|
|
|
|
end
|
2015-02-11 00:18:16 +08:00
|
|
|
|
|
|
|
it 'should return JSON' do
|
2018-06-11 12:33:07 +08:00
|
|
|
get "/admin/plugins.json"
|
2018-06-07 16:11:09 +08:00
|
|
|
expect(response.status).to eq(200)
|
2020-05-07 23:04:12 +08:00
|
|
|
expect(response.parsed_body.has_key?('plugins')).to eq(true)
|
2015-02-11 00:18:16 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|