Skip to content

Commit

Permalink
Merge pull request #11178 from saraycp/spec_token_workflow_model
Browse files Browse the repository at this point in the history
Token.:Workflow model specs
  • Loading branch information
krauselukas committed May 27, 2021
2 parents 83d2f26 + 64b453a commit 8c09837
Show file tree
Hide file tree
Showing 12 changed files with 4,689 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/api/app/models/event_subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class EventSubscription < ApplicationRecord
belongs_to :user, inverse_of: :event_subscriptions
belongs_to :group, inverse_of: :event_subscriptions
belongs_to :token, inverse_of: :event_subscriptions
belongs_to :package

validates :receiver_role, inclusion: {
in: [:maintainer, :bugowner, :reader, :source_maintainer, :target_maintainer,
Expand Down
3 changes: 1 addition & 2 deletions src/api/app/models/token/workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def call(options)
package_from_step = if step && step.valid?
step.call
else
# TODO: Raise a proper error
raise 'Something something'
raise 'Invalid workflow step definition'
end

['Event::BuildFail', 'Event::BuildSuccess'].each do |build_event|
Expand Down

0 comments on commit 8c09837

Please sign in to comment.