Files
fizzy/test/controllers/assignments/toggles_controller_test.rb
T
Mike Dalessio 44650cc36e Reload the assignees turbo frame when assigments are updated
Also, add a cache around the dropdown keyed on [bubble, bucket].
2025-03-21 17:53:41 -04:00

26 lines
854 B
Ruby

require "test_helper"
class Assignments::TogglesControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "new" do
get new_bucket_bubble_assignment_toggle_url(buckets(:writebook), bubbles(:logo))
assert_response :success
end
test "create" do
assert_changes "bubbles(:logo).assigned_to?(users(:david))", from: false, to: true do
post bucket_bubble_assignment_toggles_url(buckets(:writebook), bubbles(:logo)), params: { assignee_id: users(:david).id }, as: :turbo_stream
end
assert_response :success
assert_changes "bubbles(:logo).assigned_to?(users(:david))", from: true, to: false do
post bucket_bubble_assignment_toggles_url(buckets(:writebook), bubbles(:logo)), params: { assignee_id: users(:kevin).id }, as: :turbo_stream
end
assert_response :success
end
end