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.nil? %>
<% if current_user.support? %> <% if current_user.support? %>
<% items = [ <% items = [
{ name: t("Organisations"), url: "/organisations" }, { name: "Organisations", url: "/organisations" },
{ name: t("Users"), url: "/users" }, { name: "Users", url: "/users" },
{ name: t("Logs"), url: case_logs_path }, { name: "Logs", url: case_logs_path },
] %> ] %>
<% else %> <% else %>
<% items = [ <% items = [
{ name: t("Logs"), url: case_logs_path }, { name: "Logs", url: case_logs_path },
{ name: t("Users"), url: users_organisation_path(current_user.organisation) }, { name: "Users", url: users_organisation_path(current_user.organisation) },
{ name: t("About your organisation"), url: "/organisations/#{current_user.organisation.id}" }, { name: "About your organisation", url: "/organisations/#{current_user.organisation.id}" },
] %> ] %>
<% end %> <% end %>
<%= render partial: "layouts/primary_navigation", locals: {items: items} %> <%= 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 context "when viewing organisation page" do
it "defaults to organisation details" do it "defaults to organisation details" do
visit("/logs") visit("/logs")
click_link("About Your Organisation") click_link("About your organisation")
expect(page).to have_content(user.organisation.name) expect(page).to have_content(user.organisation.name)
end end
@ -32,7 +32,7 @@ RSpec.describe "User Features" do
visit("/organisations/#{org_id}") visit("/organisations/#{org_id}")
click_link("Users") click_link("Users")
expect(page).to have_current_path("/organisations/#{org_id}/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") expect(page).to have_current_path("/organisations/#{org_id}/details")
end end
end end
@ -72,11 +72,11 @@ RSpec.describe "User Features" do
context "when viewing organisation page" do context "when viewing organisation page" do
it "can see the details tab and users tab" do it "can see the details tab and users tab" do
visit("/logs") 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_current_path("/organisations/#{org_id}/details")
expect(page).to have_link("Logs") expect(page).to have_link("Logs")
expect(page).to have_link("Users") 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 end
end end

Loading…
Cancel
Save