|
|
@ -133,6 +133,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
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 data protection officer?") |
|
|
|
expect(page).not_to have_link("Change", text: "are you a key contact?") |
|
|
|
expect(page).not_to have_link("Change", text: "are you a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not allow deactivating the user" do |
|
|
|
|
|
|
|
expect(page).not_to have_link("Deactivate user", href: "/users/#{user.id}/deactivate") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not match the user ID" do |
|
|
|
context "when the current user does not match the user ID" do |
|
|
@ -157,6 +161,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
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 data protection officer?") |
|
|
|
expect(page).not_to have_link("Change", text: "are you a key contact?") |
|
|
|
expect(page).not_to have_link("Change", text: "are you a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not allow deactivating the user" do |
|
|
|
|
|
|
|
expect(page).not_to have_link("Deactivate user", href: "/users/#{other_user.id}/deactivate") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the user is not part of the same organisation" do |
|
|
|
context "when the user is not part of the same organisation" do |
|
|
@ -457,6 +465,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_link("Change", text: "are you a data protection officer?") |
|
|
|
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?") |
|
|
|
expect(page).to have_link("Change", text: "are you a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not allow deactivating the user" do |
|
|
|
|
|
|
|
expect(page).not_to have_link("Deactivate user", href: "/users/#{user.id}/deactivate") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not match the user ID" do |
|
|
|
context "when the current user does not match the user ID" do |
|
|
@ -482,6 +494,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_link("Change", text: "are they a data protection officer?") |
|
|
|
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?") |
|
|
|
expect(page).to have_link("Change", text: "are they a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows deactivating the user" do |
|
|
|
|
|
|
|
expect(page).to have_link("Deactivate user", href: "/users/#{other_user.id}/deactivate") |
|
|
|
|
|
|
|
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 |
|
|
@ -985,6 +1001,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_link("Change", text: "are you a data protection officer?") |
|
|
|
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?") |
|
|
|
expect(page).to have_link("Change", text: "are you a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not allow deactivating the user" do |
|
|
|
|
|
|
|
expect(page).not_to have_link("Deactivate user", href: "/users/#{user.id}/deactivate") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the current user does not match the user ID" do |
|
|
|
context "when the current user does not match the user ID" do |
|
|
@ -1010,6 +1030,10 @@ RSpec.describe UsersController, type: :request do |
|
|
|
expect(page).to have_link("Change", text: "are they a data protection officer?") |
|
|
|
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?") |
|
|
|
expect(page).to have_link("Change", text: "are they a key contact?") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows deactivating the user" do |
|
|
|
|
|
|
|
expect(page).to have_link("Deactivate user", href: "/users/#{other_user.id}/deactivate") |
|
|
|
|
|
|
|
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 |
|
|
|