Browse Source

Remove unused method

pull/1231/head
Jack S 4 years ago
parent
commit
cc1ef6f582
  1. 7
      app/helpers/tab_nav_helper.rb
  2. 22
      spec/helpers/tab_nav_helper_spec.rb

7
app/helpers/tab_nav_helper.rb

@ -21,11 +21,4 @@ module TabNavHelper
role = "<span class=\"app-!-colour-muted\">#{user.role.to_s.humanize}</span>" role = "<span class=\"app-!-colour-muted\">#{user.role.to_s.humanize}</span>"
[user.organisation.name, role].join("\n") [user.organisation.name, role].join("\n")
end end
def tab_items(user)
[
{ name: "Details", url: details_organisation_path(user.organisation) },
{ name: "Users", url: users_organisation_path(user.organisation) },
]
end
end end

22
spec/helpers/tab_nav_helper_spec.rb

@ -34,26 +34,4 @@ RSpec.describe TabNavHelper do
expect(scheme_cell(scheme)).to match(expected_html) expect(scheme_cell(scheme)).to match(expected_html)
end end
end end
describe "#tab_items" do
context "when user is a data_coordinator" do
let(:user) { FactoryBot.build(:user, :data_coordinator, organisation:) }
it "returns details and user tabs" do
result = tab_items(user).map { |i| i[:name] }
expect(result.count).to eq(2)
expect(result.first).to match("Details")
expect(result.second).to match("Users")
end
end
context "when user is a data_provider" do
it "returns details and user tabs" do
result = tab_items(user).map { |i| i[:name] }
expect(result.count).to eq(2)
expect(result.first).to match("Details")
expect(result.second).to match("Users")
end
end
end
end end

Loading…
Cancel
Save