diff --git a/test/controllers/buckets_controller_test.rb b/test/controllers/buckets_controller_test.rb index 3882e0480..0202e75cf 100644 --- a/test/controllers/buckets_controller_test.rb +++ b/test/controllers/buckets_controller_test.rb @@ -27,11 +27,17 @@ class BucketsControllerTest < ActionDispatch::IntegrationTest end test "update" do - patch bucket_url(buckets(:writebook)), params: { bucket: { name: "Writebook bugs" }, user_ids: users(:david, :jz).pluck(:id) } + patch bucket_url(buckets(:writebook)), params: { + bucket: { + name: "Writebook bugs", + all_access: false + }, + user_ids: users(:david, :jz).pluck(:id) + } assert_redirected_to bubbles_path(bucket_ids: [ buckets(:writebook) ]) assert_equal "Writebook bugs", buckets(:writebook).reload.name - assert_equal users(:david, :jz), buckets(:writebook).users + assert_equal users(:david, :jz).sort, buckets(:writebook).users.sort assert_not buckets(:writebook).all_access? end diff --git a/test/fixtures/buckets.yml b/test/fixtures/buckets.yml index b9c31d24a..d15ada078 100644 --- a/test/fixtures/buckets.yml +++ b/test/fixtures/buckets.yml @@ -3,3 +3,4 @@ writebook: account: 37s creator: david all_access: true + workflow: qa diff --git a/test/fixtures/workflow/stages.yml b/test/fixtures/workflow/stages.yml index ca76248bf..7563597fc 100644 --- a/test/fixtures/workflow/stages.yml +++ b/test/fixtures/workflow/stages.yml @@ -1,15 +1,15 @@ -qa_maybe: +qa_triage: name: Triage workflow: qa -qa_not_now: +qa_in_progress: name: In progress workflow: qa -qa_done: - name: Oh Hold +qa_on_hold: + name: On Hold workflow: qa -qa_hold: +qa_review: name: Review workflow: qa diff --git a/test/integration/bubble_messages.rb b/test/integration/bubble_messages.rb index f61751f4f..8b4ceea8c 100644 --- a/test/integration/bubble_messages.rb +++ b/test/integration/bubble_messages.rb @@ -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_maybe).id } + post bucket_bubble_stagings_url(buckets(:writebook), 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_maybe).id } + post bucket_bubble_stagings_url(buckets(:writebook), 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 diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index 20740f6fd..b5df283ad 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -5,10 +5,11 @@ class FilterTest < ActiveSupport::TestCase Current.set session: sessions(:david) do @new_bucket = accounts("37s").buckets.create! name: "Inaccessible Bucket" @new_bubble = @new_bucket.bubbles.create! + @new_bubble.update!(stage: workflow_stages(:qa_triage)) bubbles(:layout).capture Comment.new(body: "I hate haggis") bubbles(:logo).capture Comment.new(body: "I love haggis") - bubbles(:logo).update(stage: workflow_stages(:qa_maybe)) + bubbles(:logo).update(stage: workflow_stages(:qa_triage)) end assert_not_includes users(:kevin).filters.new.bubbles, @new_bubble @@ -19,7 +20,7 @@ class FilterTest < ActiveSupport::TestCase filter = users(:david).filters.new creator_ids: [ users(:david).id ], tag_ids: [ tags(:mobile).id ] assert_equal [ bubbles(:layout) ], filter.bubbles - filter = users(:david).filters.new stage_ids: [ workflow_stages(:qa_maybe).id ] + filter = users(:david).filters.new stage_ids: [ workflow_stages(:qa_triage).id ] assert_equal [ bubbles(:logo), @new_bubble ], filter.bubbles filter = users(:david).filters.new assignment_status: "unassigned", bucket_ids: [ @new_bucket.id ] @@ -105,8 +106,8 @@ class FilterTest < ActiveSupport::TestCase test "summary" do assert_equal "Most discussed, tagged #Mobile, and assigned to JZ ", filters(:jz_assignments).summary - filters(:jz_assignments).update!(stages: workflow_stages(:qa_maybe, :qa_not_now)) - assert_equal "Most discussed, tagged #Mobile, assigned to JZ, and staged in Maybe? or Not now ", filters(:jz_assignments).summary + filters(:jz_assignments).update!(stages: workflow_stages(:qa_triage, :qa_in_progress)) + assert_equal "Most discussed, tagged #Mobile, assigned to JZ, and staged in Triage or In progress ", filters(:jz_assignments).summary filters(:jz_assignments).update!(stages: [], assignees: [], tags: [], buckets: [ buckets(:writebook) ]) assert_equal "Most discussed in Writebook", filters(:jz_assignments).summary