Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Commit

Permalink
Clarify test
Browse files Browse the repository at this point in the history
  • Loading branch information
binarylogic committed Mar 1, 2017
1 parent dcc61fb commit b31e321
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec/timber/probes/active_record_log_subscriber_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@

it "should log the sql query" do
User.order("users.id DESC").all.collect # collect kicks the sql because it is lazily executed
message = " \e[1m\e[36mUser Load (0.0ms)\e[0m \e[1m\e[34mSELECT \"users\".* FROM \"users\" ORDER BY users.id DESC\e[0m @metadata {\"level\":\"debug\",\"dt\":\"2016-09-01T12:00:00.000000Z\",\"event\":{\"sql_query\":{\"sql\":\"SELECT \\\"users\\\".* FROM \\\"users\\\" ORDER BY users.id DESC\",\"time_ms\":0.0}}}\n"
# Rails 4.X adds random spaces :/
string = io.string.gsub(" ORDER BY", " ORDER BY")
string = string.gsub(" ORDER BY", " ORDER BY")
expect(string).to include("users.id DESC")
expect(string).to include("@metadata")
expect(string).to include("\"level\":\"debug\"")
expect(string).to include("\"sql\":")
expect(string).to include("\"event\":{\"server_side_app\":{\"sql_query\"")
end
end
end
Expand Down

0 comments on commit b31e321

Please sign in to comment.