Browse Source

Primary navigation labels don’t use translation strings

pull/477/head
Paul Robert Lloyd 3 years ago
parent
commit
268cf40571
  1. 12
      app/views/layouts/application.html.erb
  2. 8
      spec/features/organisation_spec.rb

12
app/views/layouts/application.html.erb

@ -65,15 +65,15 @@
<% if !current_user.nil? %>
<% if current_user.support? %>
<% items = [
{ name: t("Organisations"), url: "/organisations" },
{ name: t("Users"), url: "/users" },
{ name: t("Logs"), url: case_logs_path },
{ name: "Organisations", url: "/organisations" },
{ name: "Users", url: "/users" },
{ name: "Logs", url: case_logs_path },
] %>
<% else %>
<% items = [
{ name: t("Logs"), url: case_logs_path },
{ name: t("Users"), url: users_organisation_path(current_user.organisation) },
{ name: t("About your organisation"), url: "/organisations/#{current_user.organisation.id}" },
{ name: "Logs", url: case_logs_path },
{ name: "Users", url: users_organisation_path(current_user.organisation) },
{ name: "About your organisation", url: "/organisations/#{current_user.organisation.id}" },
] %>
<% end %>
<%= render partial: "layouts/primary_navigation", locals: {items: items} %>

8
spec/features/organisation_spec.rb

@ -24,7 +24,7 @@ RSpec.describe "User Features" do
context "when viewing organisation page" do
it "defaults to organisation details" do
visit("/logs")
click_link("About Your Organisation")
click_link("About your organisation")
expect(page).to have_content(user.organisation.name)
end
@ -32,7 +32,7 @@ RSpec.describe "User Features" do
visit("/organisations/#{org_id}")
click_link("Users")
expect(page).to have_current_path("/organisations/#{org_id}/users")
click_link("About Your Organisation")
click_link("About your organisation")
expect(page).to have_current_path("/organisations/#{org_id}/details")
end
end
@ -72,11 +72,11 @@ RSpec.describe "User Features" do
context "when viewing organisation page" do
it "can see the details tab and users tab" do
visit("/logs")
click_link("About Your Organisation")
click_link("About your organisation")
expect(page).to have_current_path("/organisations/#{org_id}/details")
expect(page).to have_link("Logs")
expect(page).to have_link("Users")
expect(page).to have_link("About Your Organisation")
expect(page).to have_link("About your organisation")
end
end
end

Loading…
Cancel
Save