Move bubble stagings out from double nesting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module WorkflowsHelper
|
||||
def button_to_set_stage(bubble, stage)
|
||||
button_to bucket_bubble_stagings_path(bubble.bucket, bubble, stage_id: stage),
|
||||
button_to bubble_stagings_path(bubble, stage_id: stage),
|
||||
method: :post, class: [ "btn full-width justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == bubble.stage } ],
|
||||
form_class: "flex align-center gap-half",
|
||||
data: { turbo_frame: "_top" } do
|
||||
|
||||
+1
-1
@@ -20,6 +20,7 @@ Rails.application.routes.draw do
|
||||
|
||||
resources :assignments
|
||||
resources :boosts
|
||||
resources :stagings
|
||||
resources :taggings
|
||||
end
|
||||
end
|
||||
@@ -52,7 +53,6 @@ Rails.application.routes.draw do
|
||||
resource :readings, only: :create
|
||||
|
||||
scope module: :bubbles do
|
||||
resources :stagings
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,14 +34,14 @@ class BubbleMessagesTest < ActionDispatch::IntegrationTest
|
||||
assert_equal "assigned", bubble.messages.last.messageable.events.last.action
|
||||
|
||||
# Stage it
|
||||
post bucket_bubble_stagings_url(buckets(:writebook), bubble), params: { stage_id: workflow_stages(:qa_triage).id }
|
||||
post bubble_stagings_url(bubble), params: { stage_id: workflow_stages(:qa_triage).id }
|
||||
assert_equal 3, bubble.messages.count
|
||||
assert_predicate bubble.messages.last, :event_summary?
|
||||
assert_equal 2, bubble.messages.last.event_summary.events.count
|
||||
assert_equal "staged", bubble.messages.last.messageable.events.last.action
|
||||
|
||||
# Unstage it
|
||||
post bucket_bubble_stagings_url(buckets(:writebook), bubble), params: { stage_id: workflow_stages(:qa_triage).id }
|
||||
post bubble_stagings_url(bubble), params: { stage_id: workflow_stages(:qa_triage).id }
|
||||
assert_equal 3, bubble.messages.count
|
||||
assert_predicate bubble.messages.last, :event_summary?
|
||||
assert_equal 3, bubble.messages.last.event_summary.events.count
|
||||
|
||||
Reference in New Issue
Block a user