This repository was archived by the owner on Apr 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +3
-14
lines changed Expand file tree Collapse file tree 8 files changed +3
-14
lines changed Original file line number Diff line number Diff line change 7
7
end
8
8
end
9
9
before do
10
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
11
10
allow_any_instance_of ( ActionDispatch ::Request ) . to receive ( :request_id ) . and_return ( :request_id )
12
11
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :application_name ) . and_return ( :app_name )
13
12
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :tags_middleware ) . and_return ( tags_middleware )
Original file line number Diff line number Diff line change 7
7
end
8
8
end
9
9
before do
10
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
11
10
allow_any_instance_of ( ActionDispatch ::Request ) . to receive ( :request_id ) . and_return ( :request_id )
12
11
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :application_name ) . and_return ( :app_name )
13
12
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :tags_middleware ) . and_return ( tags_middleware )
Original file line number Diff line number Diff line change 7
7
end
8
8
end
9
9
before do
10
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
11
10
allow_any_instance_of ( ActionDispatch ::Request ) . to receive ( :request_id ) . and_return ( :request_id )
12
11
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :application_name ) . and_return ( :app_name )
13
12
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :tags_middleware ) . and_return ( tags_middleware )
Original file line number Diff line number Diff line change 7
7
end
8
8
end
9
9
before do
10
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
11
10
allow_any_instance_of ( ActionDispatch ::Request ) . to receive ( :request_id ) . and_return ( :request_id )
12
11
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :application_name ) . and_return ( :app_name )
13
12
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :tags_middleware ) . and_return ( tags_middleware )
Original file line number Diff line number Diff line change 7
7
end
8
8
end
9
9
before do
10
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
11
10
allow_any_instance_of ( ActionDispatch ::Request ) . to receive ( :request_id ) . and_return ( :request_id )
12
11
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :application_name ) . and_return ( :app_name )
13
12
allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :tags_middleware ) . and_return ( tags_middleware )
Original file line number Diff line number Diff line change 1
1
require File . dirname ( __FILE__ ) + "/../spec_helper"
2
2
3
3
RSpec . describe "Context" , type : :request do
4
- before do
5
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
6
- end
7
-
8
4
it "resets the context after a request" do
9
5
get "/metrics"
10
6
Original file line number Diff line number Diff line change 1
1
require File . dirname ( __FILE__ ) + "/../spec_helper"
2
2
3
- RSpec . describe "Context" , type : :request do
4
- before do
5
- allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
6
- end
7
-
3
+ RSpec . describe "Logger" , type : :request do
8
4
it "logs exception" do
9
5
setup_broken_client
10
6
expect ( Rails . logger ) . to receive ( :error ) . with ( /message/ ) . at_least ( :once )
Original file line number Diff line number Diff line change 35
35
InfluxDB ::Rails . configure
36
36
37
37
allow ( InfluxDB ::Rails ) . to receive ( :client ) . and_return ( InfluxDB ::Rails ::TestClient . new )
38
+ allow_any_instance_of ( InfluxDB ::Rails ::Configuration ) . to receive ( :ignored_environments ) . and_return ( %w[ development ] )
39
+
38
40
InfluxDB ::Rails ::TestClient . metrics . clear
39
41
end
40
42
You can’t perform that action at this time.
0 commit comments