Skip to content

Commit

Permalink
Budgets as "Activity budgets" for levels C and D
Browse files Browse the repository at this point in the history
DSIT team have asked that budgets be displayed as "Activity budgets" for
levels C and D (projects and third-party projects), because budgets mean
slightly different things at levels C and D versus level B (programmes).
  • Loading branch information
CristinaRO authored and mec committed Jan 4, 2024
1 parent a3e384f commit 3160f4d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[Full changelog][unreleased]

- Display the budgets headings as "Activity budgets" for level C and D activities on the Financials tab

## Release 141 - 2023-12-04

[Full changelog][141]
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/activities/_budgets.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.govuk-grid-row
.govuk-grid-column-full
%h2.govuk-heading-m
= t("page_content.activity.budgets")
= t("page_content.activity.budgets.#{activity.to_model.level}")

- if policy(activity).create?
= link_to(t("page_content.budgets.button.create"), new_activity_budget_path(activity), class: "govuk-button")
Expand Down
6 changes: 5 additions & 1 deletion config/locales/models/activity.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ en:
activity:
unknown_country: Unknown country code (%{code})
benefitting_region_check_box: Select or deselect all countries in %{region}
budgets: Budgets
budgets:
fund: Budgets
programme: Budgets
project: Activity budgets
third_party_project: Activity budgets
button:
create: Add activity
implementing_organisation:
Expand Down
2 changes: 1 addition & 1 deletion spec/features/users_can_create_a_budget_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
scenario "they can view but not create budgets" do
visit organisation_activity_path(programme_activity.organisation, programme_activity)

expect(page).to have_content(t("page_content.activity.budgets"))
expect(page).to have_content(t("page_content.activity.budgets.programme"))
expect(page).not_to have_content(t("page_content.budgets.button.create"))
end
end
Expand Down
14 changes: 10 additions & 4 deletions spec/features/users_can_view_budgets_on_an_activity_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
context "when the user belongs to BEIS" do
let(:user) { create(:beis_user) }

context "when the activity is fund_level" do
context "when the activity is a fund" do
scenario "budget information is shown on the page" do
fund_activity = create(:fund_activity, organisation: user.organisation)
create(:programme_activity, parent: fund_activity)
Expand All @@ -16,6 +16,7 @@

visit organisation_activity_path(fund_activity.organisation, fund_activity)

expect(page).to have_content(t("page_content.activity.budgets.fund"))
budget_information_is_shown_on_page(budget_presenter)
end

Expand All @@ -34,7 +35,7 @@
end
end

context "when the activity is programme level" do
context "when the activity is a programme" do
scenario "budget information is shown on the page" do
fund_activity = create(:fund_activity, organisation: user.organisation)
programme_activity = create(:programme_activity, parent: fund_activity, organisation: user.organisation)
Expand All @@ -44,12 +45,14 @@

visit organisation_activity_path(programme_activity.organisation, programme_activity)

expect(page).to have_content(t("page_content.activity.budgets.programme"))
budget_information_is_shown_on_page(budget_presenter)
end
end

context "when the activity is project level" do
context "when the activity is a project" do
let(:partner_org_user) { create(:partner_organisation_user) }

scenario "budget information is shown on the page" do
fund_activity = create(:fund_activity, organisation: user.organisation)
programme_activity = create(:programme_activity, parent: fund_activity, organisation: user.organisation)
Expand All @@ -60,6 +63,7 @@

visit organisation_activity_path(project_activity.organisation, project_activity)

expect(page).to have_content(t("page_content.activity.budgets.project"))
budget_information_is_shown_on_page(budget_presenter)
end

Expand Down Expand Up @@ -99,6 +103,7 @@
click_link programme_activity.title
end

expect(page).to have_content(t("page_content.activity.budgets.programme"))
budget_information_is_shown_on_page(budget_presenter)
end

Expand All @@ -115,7 +120,7 @@
end
end

context "when the activity is project level" do
context "when the activity is a project" do
scenario "budget information is shown on the page" do
programme_activity = create(:programme_activity, extending_organisation: user.organisation)
project_activity = create(:project_activity, parent: programme_activity, organisation: user.organisation)
Expand All @@ -129,6 +134,7 @@
click_on t("tabs.activity.children")
click_link project_activity.title

expect(page).to have_content(t("page_content.activity.budgets.project"))
budget_information_is_shown_on_page(budget_presenter)
end

Expand Down

0 comments on commit 3160f4d

Please sign in to comment.