File tree 6 files changed +16
-16
lines changed
6 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 1
1
PATH
2
2
remote: .
3
3
specs:
4
- flagsmith (3.0.1 )
4
+ flagsmith (3.0.2 )
5
5
faraday
6
6
faraday-retry
7
7
faraday_middleware
40
40
faraday (~> 1.0 )
41
41
gem-release (2.2.0 )
42
42
method_source (1.0.0 )
43
- multipart-post (2.2.0 )
43
+ multipart-post (2.2.3 )
44
44
parallel (1.20.1 )
45
45
parser (3.0.0.0 )
46
46
ast (~> 2.4.1 )
50
50
rainbow (3.0.0 )
51
51
rake (13.0.3 )
52
52
regexp_parser (2.0.3 )
53
- rexml (3.2.4 )
53
+ rexml (3.2.5 )
54
54
rspec (3.10.0 )
55
55
rspec-core (~> 3.10.0 )
56
56
rspec-expectations (~> 3.10.0 )
Original file line number Diff line number Diff line change 172
172
public_suffix (4.0.7 )
173
173
puma (5.6.4 )
174
174
nio4r (~> 2.0 )
175
- rack (2.2.3 )
175
+ rack (2.2.3.1 )
176
176
rack-test (1.1.0 )
177
177
rack (>= 1.0 , < 3 )
178
178
rainbow (3.1.1 )
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ def flush
31
31
@last_flushed = Time . now
32
32
end
33
33
34
- def track_feature ( feature_id )
35
- @analytics_data [ feature_id ] = @analytics_data . fetch ( feature_id , 0 ) + 1
34
+ def track_feature ( feature_name )
35
+ @analytics_data [ feature_name ] = @analytics_data . fetch ( feature_name , 0 ) + 1
36
36
flush if ( Time . now - @last_flushed ) > TIMER * 1000
37
37
end
38
38
end
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def feature_value(feature_name)
122
122
def get_flag ( feature_name )
123
123
key = Flagsmith ::Flags ::Collection . normalize_key ( feature_name )
124
124
flag = flags . fetch ( key )
125
- @analytics_processor . track_feature ( flag . feature_id ) if @analytics_processor && flag . feature_id
125
+ @analytics_processor . track_feature ( flag . feature_name ) if @analytics_processor && flag . feature_id
126
126
flag
127
127
rescue KeyError
128
128
return @default_flag_handler . call ( feature_name ) if @default_flag_handler
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
module Flagsmith
4
- VERSION = '3.0.1 '
4
+ VERSION = '3.0.2 '
5
5
end
Original file line number Diff line number Diff line change 19
19
end
20
20
21
21
it 'test_analytics_processor_track_feature_updates_analytics_data' do
22
- subject . track_feature ( 1 )
23
- expect ( subject . analytics_data [ 1 ] ) . to eq ( 1 )
22
+ subject . track_feature ( "my_feature" )
23
+ expect ( subject . analytics_data [ "my_feature" ] ) . to eq ( 1 )
24
24
25
- subject . track_feature ( 1 )
26
- expect ( subject . analytics_data [ 1 ] ) . to eq ( 2 )
25
+ subject . track_feature ( "my_feature" )
26
+ expect ( subject . analytics_data [ "my_feature" ] ) . to eq ( 2 )
27
27
end
28
28
29
29
it 'test_analytics_processor_flush_clears_analytics_data' do
30
- subject . track_feature ( 1 )
30
+ subject . track_feature ( "my_feature" )
31
31
subject . flush
32
32
expect ( subject . analytics_data ) . to eql ( { } )
33
33
end
34
34
35
35
it 'test_analytics_processor_flush_post_request_data_match_ananlytics_data' do
36
- subject . track_feature ( 1 )
37
- subject . track_feature ( 2 )
36
+ subject . track_feature ( "my_feature_1" )
37
+ subject . track_feature ( "my_feature_2" )
38
38
expect ( flagsmith . api_client ) . to receive ( :post ) . exactly ( 1 ) . times do |uri_path , body |
39
39
expect ( uri_path ) . to eq ( 'analytics/flags/' )
40
- expect ( body ) . to eq ( { 1 => 1 , 2 => 1 } . to_json )
40
+ expect ( body ) . to eq ( { "my_feature_1" => 1 , "my_feature_2" => 1 } . to_json )
41
41
end
42
42
subject . flush
43
43
end
You can’t perform that action at this time.
0 commit comments