mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-08 07:40:08 +09:00
Merge remote-tracking branch 'upstream/main' into cursor/split-sidebar-membership-queries-8545
Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
@@ -11,6 +11,13 @@ class Users::ProfilesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "show includes install instructions for Edge" do
|
||||
get user_profile_url, headers: { "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363" }
|
||||
|
||||
assert_response :success
|
||||
assert_select ".pwa__instructions img[src*='install-edge']"
|
||||
end
|
||||
|
||||
test "update" do
|
||||
put user_profile_url, params: { user: { name: "John Doe", bio: "Acrobat" } }
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
<% password_digest = BCrypt::Password.create("secret123456") %>
|
||||
<% password_digest = BCrypt::Password.create("secret123456", cost: BCrypt::Engine::MIN_COST) %>
|
||||
|
||||
david:
|
||||
name: David
|
||||
|
||||
@@ -20,6 +20,21 @@ class Message::SearchableTest < ActiveSupport::TestCase
|
||||
assert_equal messages, rooms(:designers).messages.search("cat")
|
||||
end
|
||||
|
||||
test "the last page of matches holds the newest ones, read off the index without sorting every match" do
|
||||
messages = [ "first cat", "second cat", "third cat" ].map do |body|
|
||||
rooms(:designers).messages.create! body: body, client_message_id: body, creator: users(:david)
|
||||
end
|
||||
|
||||
queries = []
|
||||
collect = ->(*, payload) { queries << payload[:sql] if payload[:sql].include?("message_search_index") }
|
||||
page = ActiveSupport::Notifications.subscribed(collect, "sql.active_record") do
|
||||
rooms(:designers).messages.search("cat").last_page_of_matches(2)
|
||||
end
|
||||
|
||||
assert_equal messages.last(2), page
|
||||
assert_no_match(/TEMP B-TREE/, Message.connection.select_rows("EXPLAIN QUERY PLAN #{queries.sole}").map(&:last).join(" | "))
|
||||
end
|
||||
|
||||
test "rich text body is converted to plain text for indexing" do
|
||||
message = rooms(:designers).messages.create! body: "<span>My hovercraft is full of eels</span>", client_message_id: "earth", creator: users(:david)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class WebhookTest < ActiveSupport::TestCase
|
||||
|
||||
test "delivery with error reply" do
|
||||
assert_no_difference -> { Message.count } do
|
||||
WebMock.stub_request(:post, webhooks(:bender).url).to_return(status: 500, body: "Internal Error!", headers: {})
|
||||
WebMock.stub_request(:post, webhooks(:bender).url).to_return(status: 500, body: "<h1>Internal Error!</h1>", headers: { "Content-Type" => "text/html" })
|
||||
response = webhooks(:bender).deliver(messages(:first))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user