|
|
@ -1188,7 +1188,7 @@ RSpec.describe UsersController, type: :request do |
|
|
|
describe "#index" do |
|
|
|
describe "#index" do |
|
|
|
let!(:other_user) { create(:user, organisation: user.organisation, name: "User 2", email: "other@example.com") } |
|
|
|
let!(:other_user) { create(:user, organisation: user.organisation, name: "User 2", email: "other@example.com") } |
|
|
|
let!(:inactive_user) { create(:user, organisation: user.organisation, active: false, name: "User 3", email: "inactive@example.com", last_sign_in_at: Time.zone.local(2022, 10, 10)) } |
|
|
|
let!(:inactive_user) { create(:user, organisation: user.organisation, active: false, name: "User 3", email: "inactive@example.com", last_sign_in_at: Time.zone.local(2022, 10, 10)) } |
|
|
|
let!(:other_org_user) { create(:user, name: "User 4", email: "otherorg@otherexample.com", organisation: create(:organisation, :without_dpc)) } |
|
|
|
let!(:other_org_user) { create(:user, name: "User 4", email: "otherorg@otherexample.com", organisation: create(:organisation, :without_dpc, name: "Other name")) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
get "/users", headers:, params: {} |
|
|
|
get "/users", headers:, params: {} |
|
|
@ -1201,6 +1201,11 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_content(other_org_user.name) |
|
|
|
expect(page).to have_content(other_org_user.name) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "links to user organisations" do |
|
|
|
|
|
|
|
expect(page).to have_link(user.organisation.name, href: "/organisations/#{user.organisation.id}/lettings-logs", count: 3) |
|
|
|
|
|
|
|
expect(page).to have_link(other_org_user.organisation.name, href: "/organisations/#{other_org_user.organisation.id}/lettings-logs", count: 1) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows last logged in date for all users" do |
|
|
|
it "shows last logged in date for all users" do |
|
|
|
expect(page).to have_content("10 October 2022") |
|
|
|
expect(page).to have_content("10 October 2022") |
|
|
|
end |
|
|
|
end |
|
|
@ -1432,6 +1437,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_link("Change", text: "if a key contact") |
|
|
|
expect(page).to have_link("Change", text: "if a key contact") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "links to user organisation" do |
|
|
|
|
|
|
|
expect(page).to have_link(other_user.organisation.name, href: "/organisations/#{other_user.organisation.id}/lettings-logs") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "does not show option to resend confirmation email" do |
|
|
|
it "does not show option to resend confirmation email" do |
|
|
|
expect(page).not_to have_button("Resend invite link") |
|
|
|
expect(page).not_to have_button("Resend invite link") |
|
|
|
end |
|
|
|
end |
|
|
|