test board columns controller refreshes sibling columns
This commit is contained in:
@@ -19,6 +19,17 @@ class Boards::ColumnsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_equal "New Column", boards(:writebook).columns.last.name
|
||||
end
|
||||
|
||||
test "create refreshes sibling columns" do
|
||||
board = boards(:writebook)
|
||||
existing_columns = board.columns.to_a
|
||||
|
||||
post board_columns_path(board), params: { column: { name: "New Column" } }, as: :turbo_stream
|
||||
|
||||
existing_columns.each do |column|
|
||||
assert_turbo_stream action: :replace, target: dom_id(column)
|
||||
end
|
||||
end
|
||||
|
||||
test "update" do
|
||||
column = columns(:writebook_in_progress)
|
||||
|
||||
@@ -36,4 +47,16 @@ class Boards::ColumnsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
test "destroy refreshes sibling columns" do
|
||||
board = boards(:writebook)
|
||||
column = columns(:writebook_on_hold)
|
||||
sibling_columns = column.sibling_columns.to_a
|
||||
|
||||
delete board_column_path(board, column), as: :turbo_stream
|
||||
|
||||
sibling_columns.each do |sibling_column|
|
||||
assert_turbo_stream action: :replace, target: dom_id(sibling_column)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user