|
77 | 77 | treatment: 'off', |
78 | 78 | config: nil |
79 | 79 | ) |
| 80 | + expect(subject.get_treatment_with_config('nicolas', 'mauro_test', {}, nil)).to eq( |
| 81 | + treatment: 'off', |
| 82 | + config: nil |
| 83 | + ) |
| 84 | + expect(subject.get_treatment_with_config('nicolas', 'mauro_test', {}, {})).to eq( |
| 85 | + treatment: 'off', |
| 86 | + config: nil |
| 87 | + ) |
| 88 | + expect(subject.get_treatment_with_config('nicolas', 'mauro_test', {}, "prop")).to eq( |
| 89 | + treatment: 'off', |
| 90 | + config: nil |
| 91 | + ) |
| 92 | + expect(subject.get_treatment_with_config('nicolas', 'mauro_test', {}, 123)).to eq( |
| 93 | + treatment: 'off', |
| 94 | + config: nil |
| 95 | + ) |
80 | 96 | close_redis |
81 | 97 | end |
82 | 98 |
|
83 | 99 | it 'get_treatment returns off' do |
84 | 100 | expect(subject.get_treatment('nicolas', 'mauro_test', nil)).to eq 'off' |
85 | 101 | expect(subject.get_treatment('nicolas', 'mauro_test')).to eq 'off' |
86 | 102 | expect(subject.get_treatment('nicolas', 'mauro_test', {})).to eq 'off' |
| 103 | + expect(subject.get_treatment('nicolas', 'mauro_test', {}, nil)).to eq 'off' |
| 104 | + expect(subject.get_treatment('nicolas', 'mauro_test', {}, {})).to eq 'off' |
| 105 | + expect(subject.get_treatment('nicolas', 'mauro_test', {}, "prop")).to eq 'off' |
| 106 | + expect(subject.get_treatment('nicolas', 'mauro_test', {}, 123)).to eq 'off' |
87 | 107 | end |
88 | 108 |
|
89 | 109 | it 'get_treatments returns off' do |
|
96 | 116 | expect(subject.get_treatments('nicolas', ['mauro_test'], {})).to eq( |
97 | 117 | mauro_test: 'off' |
98 | 118 | ) |
| 119 | + expect(subject.get_treatments('nicolas', ['mauro_test'], {}, nil)).to eq( |
| 120 | + mauro_test: 'off' |
| 121 | + ) |
| 122 | + expect(subject.get_treatments('nicolas', ['mauro_test'], {}, {})).to eq( |
| 123 | + mauro_test: 'off' |
| 124 | + ) |
| 125 | + expect(subject.get_treatments('nicolas', ['mauro_test'], {}, "prop")).to eq( |
| 126 | + mauro_test: 'off' |
| 127 | + ) |
| 128 | + expect(subject.get_treatments('nicolas', ['mauro_test'], {}, 123)).to eq( |
| 129 | + mauro_test: 'off' |
| 130 | + ) |
99 | 131 | close_redis |
100 | 132 | end |
101 | 133 |
|
|
109 | 141 | expect(subject.get_treatments_by_flag_set('nicolas', 'set_2', {})).to eq( |
110 | 142 | mauro_test: 'off' |
111 | 143 | ) |
| 144 | + expect(subject.get_treatments_by_flag_set('nicolas', 'set_2', {}, {})).to eq( |
| 145 | + mauro_test: 'off' |
| 146 | + ) |
| 147 | + expect(subject.get_treatments_by_flag_set('nicolas', 'set_2', {}, nil)).to eq( |
| 148 | + mauro_test: 'off' |
| 149 | + ) |
| 150 | + expect(subject.get_treatments_by_flag_set('nicolas', 'set_2', {}, "prop")).to eq( |
| 151 | + mauro_test: 'off' |
| 152 | + ) |
| 153 | + expect(subject.get_treatments_by_flag_set('nicolas', 'set_2', {}, 123)).to eq( |
| 154 | + mauro_test: 'off' |
| 155 | + ) |
112 | 156 | close_redis |
113 | 157 | end |
114 | 158 |
|
|
122 | 166 | expect(subject.get_treatments_by_flag_sets('nicolas', ['set_2'], {})).to eq( |
123 | 167 | mauro_test: 'off' |
124 | 168 | ) |
| 169 | + expect(subject.get_treatments_by_flag_sets('nicolas', ['set_2'], {}, {})).to eq( |
| 170 | + mauro_test: 'off' |
| 171 | + ) |
| 172 | + expect(subject.get_treatments_by_flag_sets('nicolas', ['set_2'], {}, nil)).to eq( |
| 173 | + mauro_test: 'off' |
| 174 | + ) |
| 175 | + expect(subject.get_treatments_by_flag_sets('nicolas', ['set_2'], {}, "prop")).to eq( |
| 176 | + mauro_test: 'off' |
| 177 | + ) |
| 178 | + expect(subject.get_treatments_by_flag_sets('nicolas', ['set_2'], {}, 123)).to eq( |
| 179 | + mauro_test: 'off' |
| 180 | + ) |
125 | 181 | close_redis |
126 | 182 | end |
127 | 183 | end |
|
141 | 197 | end |
142 | 198 |
|
143 | 199 | it 'returns CONTROL and label for incorrect feature name' do |
144 | | - treatment = subject.get_treatment('random_user_id', 'test_featur', nil, nil, false, true) |
145 | | - puts treatment |
| 200 | + treatment = subject.get_treatment('random_user_id', 'test_featur', nil, nil, nil, false, true) |
146 | 201 | expect(treatment).to eq( |
147 | 202 | treatment: SplitIoClient::Engine::Models::Treatment::CONTROL, |
148 | 203 | label: SplitIoClient::Engine::Models::Label::NOT_FOUND, |
|
229 | 284 |
|
230 | 285 | #TODO We will remove multiple param in the future. |
231 | 286 | it 'returns CONTROL and label on nil key' do |
232 | | - expect(subject.get_treatment(nil, 'test_feature', nil, nil, false, true)).to eq( |
| 287 | + expect(subject.get_treatment(nil, 'test_feature', nil, nil, nil, false, true)).to eq( |
233 | 288 | treatment: SplitIoClient::Engine::Models::Treatment::CONTROL, |
234 | 289 | label: nil, |
235 | 290 | change_number: nil |
|
289 | 344 |
|
290 | 345 | #TODO We will remove multiple param in the future. |
291 | 346 | it 'returns CONTROL and label on nil split_name' do |
292 | | - expect(subject.get_treatment('random_user_id', nil, nil, nil, false, true)).to eq( |
| 347 | + expect(subject.get_treatment('random_user_id', nil, nil, nil, nil, false, true)).to eq( |
293 | 348 | treatment: SplitIoClient::Engine::Models::Treatment::CONTROL, |
294 | 349 | label: nil, |
295 | 350 | change_number: nil |
|
0 commit comments