diff --git a/spec/controllers/admin/plugins_controller_spec.rb b/spec/requests/admin/plugins_controller_spec.rb similarity index 81% rename from spec/controllers/admin/plugins_controller_spec.rb rename to spec/requests/admin/plugins_controller_spec.rb index a1907c23748..57175ebbb4b 100644 --- a/spec/controllers/admin/plugins_controller_spec.rb +++ b/spec/requests/admin/plugins_controller_spec.rb @@ -7,13 +7,14 @@ describe Admin::PluginsController do end context "while logged in as an admin" do - let!(:admin) { log_in(:admin) } + before do + sign_in(Fabricate(:admin)) + end it 'should return JSON' do - get :index, format: :json + get "/admin/plugins.json" expect(response.status).to eq(200) expect(::JSON.parse(response.body).has_key?('plugins')).to eq(true) end end - end