Browse Source

Add role to users table

pull/138/head
baarkerlounger 4 years ago
parent
commit
ab08ad988d
  1. 2
      app/helpers/user_table_helper.rb
  2. 2
      spec/helpers/user_table_helper_spec.rb

2
app/helpers/user_table_helper.rb

@ -6,7 +6,7 @@ module UserTableHelper
end
def org_cell(user)
role = "<span class='app-!-colour-muted'>#{user.role}</span>"
role = "<span class='app-!-colour-muted'>#{user.role.to_s.humanize}</span>"
[user.organisation.name, role].join("\n")
end
end

2
spec/helpers/user_table_helper_spec.rb

@ -12,7 +12,7 @@ RSpec.describe UserTableHelper do
describe "#org_cell" do
it "returns the users org name and role separated by a newline character" do
expected_html = "DLUHC\n<span class='app-!-colour-muted'>Data Provider</span>"
expected_html = "DLUHC\n<span class='app-!-colour-muted'>Data provider</span>"
expect(org_cell(user)).to match(expected_html)
end
end

Loading…
Cancel
Save