1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
# frozen_string_literal: true
describe "Logging" do
context "RSpec integration" do
specify "global all", :aggregate_failures do
output = run_rspec("logging", env: {"LOG" => "all"}, options: "--tag test:global")
expect(output).to include("examples, 0 failures")
expect(output).to include("INSERT INTO")
expect(output).to include("USER: a")
expect(output).to include("USER: b")
end
specify "global active record", :aggregate_failures do
output = run_rspec("logging", env: {"LOG" => "ar"}, options: "--tag test:global")
expect(output).to include("examples, 0 failures")
expect(output).to include("INSERT INTO")
expect(output).not_to include("USER: a")
expect(output).not_to include("USER: b")
end
specify "tags", :aggregate_failures do
output = run_rspec("logging", env: {"LOG" => "ar"}, options: "--tag test:tags")
expect(output).to include("examples, 0 failures")
expect(output).to include("INSERT INTO")
expect(output).not_to include("USER: invisible")
expect(output).to include("USER: visible")
end
end
end
|