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

wth - (SPARCRequest & SPARCDashboard) Switching PI Bug #285

Merged
merged 1 commit into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/associated_user_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize(params)
@successful = true
if @protocol_role.role == 'primary-pi'
protocol.project_roles.primary_pis.each do |pr|
pr.update_attributes(project_rights: 'request', role: 'general-access-user')
pr.update_attributes(project_rights: 'approve', role: 'general-access-user')
end
end
@protocol_role.save
Expand Down
2 changes: 1 addition & 1 deletion lib/associated_user_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(params)

if @protocol_role.role == 'primary-pi'
protocol.project_roles.where(role: 'primary-pi').where.not(identity_id: @protocol_role.identity_id).each do |pr|
pr.update_attributes(project_rights: 'request', role: 'general-access-user')
pr.update_attributes(project_rights: 'approve', role: 'general-access-user')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def then_i_should_see_the_old_primary_pi_is_a_general_user

def then_i_should_see_the_old_primary_pi_has_request_rights
wait_for_javascript_to_finish
expect(ProjectRole.find_by(identity_id: logged_in_user.id, protocol_id: protocol.id).project_rights).to eq('request')
expect(ProjectRole.find_by(identity_id: logged_in_user.id, protocol_id: protocol.id).project_rights).to eq('approve')
end

def then_i_should_see_an_error_of_type error_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def then_i_should_see_the_old_primary_pi_is_a_general_user

def then_i_should_see_the_old_primary_pi_has_request_rights
wait_for_javascript_to_finish
expect(ProjectRole.find_by(identity_id: logged_in_user.id, protocol_id: protocol.id).project_rights).to eq('request')
expect(ProjectRole.find_by(identity_id: logged_in_user.id, protocol_id: protocol.id).project_rights).to eq('approve')
end

def then_i_should_see_an_error_of_type error_type
Expand Down