-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9359 from DFE-Digital/1634-update-provider-report…
…s-view Update Providers Reports index
- Loading branch information
Showing
12 changed files
with
246 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module ProviderInterface | ||
class ReportsController < ProviderInterfaceController | ||
def index | ||
@providers = current_user.providers | ||
@providers = current_user.providers.preload(:performance_reports) | ||
@performance_reports = current_user.providers.any? { _1.performance_reports.present? } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 0 additions & 105 deletions
105
spec/system/provider_interface/provider_reports_page_spec.rb
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
spec/system/provider_interface/reports/index_provider_user_one_provider_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.feature 'Provider reports index' do | ||
include DfESignInHelpers | ||
scenario 'when provider user has one provider' do | ||
given_a_provider_and_provider_user_exists | ||
and_i_am_signed_in_as_provider_user | ||
when_i_visit_the_reports_index | ||
then_the_page_has_the_right_content | ||
end | ||
|
||
def when_i_visit_the_reports_index | ||
visit provider_interface_reports_path | ||
expect(page).to have_current_path('/provider/reports') | ||
end | ||
|
||
def given_a_provider_and_provider_user_exists | ||
@provider_user = create(:provider_user, :with_dfe_sign_in, email_address: '[email protected]') | ||
@provider = @provider_user.providers.first | ||
end | ||
|
||
def then_the_page_has_the_right_content | ||
expect(page).to have_css('h1', text: 'Reports') | ||
expect(page).to have_css('h2', text: 'Application data for this recruitment cycle') | ||
expect(page).to have_link('Status of active applications', href: provider_interface_reports_provider_status_of_active_applications_path(provider_id: @provider)) | ||
expect(page).to have_link('Sex, disability, ethnicity and age of candidates', href: provider_interface_reports_provider_diversity_report_path(provider_id: @provider)) | ||
expect(page).to have_link('Withdrawals', href: provider_interface_reports_provider_withdrawal_report_path(provider_id: @provider)) | ||
expect(page).to have_css('h2', text: 'Download and export') | ||
expect(page).to have_link('Export application data', href: provider_interface_new_application_data_export_path) | ||
expect(page).to have_link('Export data for Higher Education Statistics Agency (HESA)', href: provider_interface_reports_hesa_exports_path) | ||
end | ||
|
||
def and_i_am_signed_in_as_provider_user | ||
provider_exists_in_dfe_sign_in | ||
provider_signs_in_using_dfe_sign_in | ||
expect(page).to have_current_path('/provider/applications') | ||
end | ||
end |
Oops, something went wrong.