Skip to content

Commit

Permalink
Create test data for role revoked web notification
Browse files Browse the repository at this point in the history
  • Loading branch information
krauselukas committed Jun 3, 2024
1 parent 85283ae commit 40bb474
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/lib/tasks/dev/notifications.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ namespace :dev do
admin_home_project = admin.home_project || RakeSupport.create_and_assign_project(admin.home_project_name, admin)
requestor_project = Project.find_by(name: 'requestor_project') || RakeSupport.create_and_assign_project('requestor_project', requestor)

# Create notification for roles revoked
User.find_by(login: 'Iggy').run_as do
home_project_iggy = Project.find_by(name: 'home:Iggy')
role = Role.find_by_title!('maintainer')
Relationship::AddRole.new(home_project_iggy, role, check: true, user: admin).add_role
home_project_iggy.store
home_project_iggy.remove_role(admin, role)
home_project_iggy.store
end

repetitions.times do |repetition|
package_name = "package_#{Time.now.to_i}_#{repetition}"
admin_package = create(:package_with_file, name: package_name, project: admin_home_project)
Expand Down

0 comments on commit 40bb474

Please sign in to comment.