|
|
|
@ -6,6 +6,8 @@ describe Admin::DashboardController, type: :controller do
|
|
|
|
|
let(:page) { Capybara::Node::Simple.new(response.body) } |
|
|
|
|
let(:resource_title) { "Dashboard" } |
|
|
|
|
let!(:case_log) { FactoryBot.create(:case_log, :in_progress) } |
|
|
|
|
let!(:case_log_2) { FactoryBot.create(:case_log, :in_progress) } |
|
|
|
|
let!(:completed_case_log) { FactoryBot.create(:case_log, :completed) } |
|
|
|
|
let(:valid_session) { {} } |
|
|
|
|
login_admin_user |
|
|
|
|
|
|
|
|
@ -23,11 +25,17 @@ describe Admin::DashboardController, type: :controller do
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "returns a panel of in progress case logs" do |
|
|
|
|
expect(page).to have_xpath("//div[@class='panel' and //h3[contains(., 'Total case logs in progress')]]") |
|
|
|
|
panel_xpath = "//div[@class='panel' and .//h3[contains(., 'Total case logs in progress')]]" |
|
|
|
|
panel_content_xpath = panel_xpath + "//div[@class='panel_contents' and .//p[contains(., 2)]]" |
|
|
|
|
expect(page).to have_xpath(panel_xpath) |
|
|
|
|
expect(page).to have_xpath(panel_content_xpath) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "returns a panel of completed case logs" do |
|
|
|
|
expect(page).to have_xpath("//div[@class='panel' and //h3[contains(., 'Total case logs completed')]]") |
|
|
|
|
panel_xpath = "//div[@class='panel' and .//h3[contains(., 'Total case logs completed')]]" |
|
|
|
|
panel_content_xpath = panel_xpath + "//div[@class='panel_contents' and .//p[contains(., 1)]]" |
|
|
|
|
expect(page).to have_xpath(panel_xpath) |
|
|
|
|
expect(page).to have_xpath(panel_content_xpath) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|