Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore deleted team members on project's page #320

Merged
merged 4 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
class InternalApi::V1::CompanyUsersController < InternalApi::V1::ApplicationController
def index
authorize CompanyUser
render :index, locals: { users: current_company.users }, status: :ok
render :index, locals: { users: current_company.users.kept }, status: :ok
end
end
3 changes: 3 additions & 0 deletions spec/requests/internal_api/v1/company_users/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
let(:user1) { create(:user, current_workspace_id: company1.id) }
let(:user2) { create(:user) }
let(:user3) { create(:user) }
let(:user4) { create(:user) }

before do
create(:company_user, company_id: company1.id, user_id: user1.id)
create(:company_user, company_id: company1.id, user_id: user2.id)
create(:company_user, company_id: company2.id, user_id: user3.id)
create(:company_user, company_id: company1.id, user_id: user4.id)
end

context "when user is admin" do
before do
user1.add_role :admin, company1
sign_in user1
user4.discard
send_request :get, internal_api_v1_company_users_path
end

Expand Down