2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe Admin::DashboardController do
|
2017-09-10 17:25:29 +05:30
|
|
|
describe '#index' do
|
2021-01-29 00:20:46 +05:30
|
|
|
before do
|
|
|
|
sign_in(create(:admin))
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'retrieves Redis versions' do
|
|
|
|
get :index
|
|
|
|
|
|
|
|
expect(assigns[:redis_versions].length).to eq(1)
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
context 'with pending_delete projects' do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
it 'does not retrieve projects that are pending deletion' do
|
|
|
|
project = create(:project)
|
|
|
|
pending_delete_project = create(:project, pending_delete: true)
|
|
|
|
|
|
|
|
get :index
|
|
|
|
|
|
|
|
expect(response.body).to match(project.name)
|
|
|
|
expect(response.body).not_to match(pending_delete_project.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|