|
|
@ -121,6 +121,15 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "show the user details" do |
|
|
|
it "show the user details" do |
|
|
|
expect(page).to have_content("Your account") |
|
|
|
expect(page).to have_content("Your account") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing name, email and password" do |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "name") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "email address") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "password") |
|
|
|
|
|
|
|
expect(page).not_to have_link("Change", text: "role") |
|
|
|
|
|
|
|
expect(page).not_to have_link("Change", text: "are you a data protection officer?") |
|
|
|
|
|
|
|
expect(page).not_to have_link("Change", text: "are you a key contact?") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not matches the user ID" do |
|
|
|
context "when the current user does not matches the user ID" do |
|
|
@ -149,6 +158,14 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "show the edit personal details page" do |
|
|
|
it "show the edit personal details page" do |
|
|
|
expect(page).to have_content("Change your personal details") |
|
|
|
expect(page).to have_content("Change your personal details") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has fields for name and email" do |
|
|
|
|
|
|
|
expect(page).to have_field("user[name]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[email]") |
|
|
|
|
|
|
|
expect(page).not_to have_field("user[role]") |
|
|
|
|
|
|
|
expect(page).not_to have_field("user[is_dpo]") |
|
|
|
|
|
|
|
expect(page).not_to have_field("user[is_key_contact]") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not matches the user ID" do |
|
|
|
context "when the current user does not matches the user ID" do |
|
|
@ -308,6 +325,15 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "show the user details" do |
|
|
|
it "show the user details" do |
|
|
|
expect(page).to have_content("Your account") |
|
|
|
expect(page).to have_content("Your account") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing name, email, password, role, dpo and key contact" do |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "name") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "email address") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "password") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "role") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "are you a data protection officer?") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "are you a key contact?") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not matches the user ID" do |
|
|
|
context "when the current user does not matches the user ID" do |
|
|
@ -324,6 +350,15 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "shows the user details page" do |
|
|
|
it "shows the user details page" do |
|
|
|
expect(page).to have_content("#{other_user.name}’s account") |
|
|
|
expect(page).to have_content("#{other_user.name}’s account") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing name, email, role, dpo and key contact" do |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "name") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "email address") |
|
|
|
|
|
|
|
expect(page).not_to have_link("Change", text: "password") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "role") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "are they a data protection officer?") |
|
|
|
|
|
|
|
expect(page).to have_link("Change", text: "are they a key contact?") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the user is not part of the same organisation as the current user" do |
|
|
|
context "when the user is not part of the same organisation as the current user" do |
|
|
@ -350,6 +385,14 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "show the edit personal details page" do |
|
|
|
it "show the edit personal details page" do |
|
|
|
expect(page).to have_content("Change your personal details") |
|
|
|
expect(page).to have_content("Change your personal details") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has fields for name, email, role, dpo and key contact" do |
|
|
|
|
|
|
|
expect(page).to have_field("user[name]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[email]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[role]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[is_dpo]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[is_key_contact]") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not matches the user ID" do |
|
|
|
context "when the current user does not matches the user ID" do |
|
|
@ -366,6 +409,14 @@ RSpec.describe UsersController, type: :request do |
|
|
|
it "shows the user details page" do |
|
|
|
it "shows the user details page" do |
|
|
|
expect(page).to have_content("Change #{other_user.name}’s personal details") |
|
|
|
expect(page).to have_content("Change #{other_user.name}’s personal details") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has fields for name, email, role, dpo and key contact" do |
|
|
|
|
|
|
|
expect(page).to have_field("user[name]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[email]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[role]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[is_dpo]") |
|
|
|
|
|
|
|
expect(page).to have_field("user[is_key_contact]") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the user is not part of the same organisation as the current user" do |
|
|
|
context "when the user is not part of the same organisation as the current user" do |
|
|
|