@ -515,6 +515,10 @@ RSpec.describe UsersController, type: :request do
it " shows if user is not active " do
it " shows if user is not active " do
expect ( page ) . to have_content ( " This user has been deactivated. " )
expect ( page ) . to have_content ( " This user has been deactivated. " )
end
end
it " allows reactivating the user " do
expect ( page ) . to have_link ( " Reactivate user " , href : " /users/ #{ other_user . id } /reactivate " )
end
end
end
end
end
@ -1086,6 +1090,21 @@ RSpec.describe UsersController, type: :request do
it " allows deactivating the user " do
it " allows deactivating the user " do
expect ( page ) . to have_link ( " Deactivate user " , href : " /users/ #{ other_user . id } /deactivate " )
expect ( page ) . to have_link ( " Deactivate user " , href : " /users/ #{ other_user . id } /deactivate " )
end
end
context " when user is deactivated " do
before do
other_user . update! ( active : false )
get " /users/ #{ other_user . id } " , headers : , params : { }
end
it " shows if user is not active " do
expect ( page ) . to have_content ( " This user has been deactivated. " )
end
it " allows reactivating the user " do
expect ( page ) . to have_link ( " Reactivate user " , href : " /users/ #{ other_user . id } /reactivate " )
end
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