Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def variation_for_all(variation)
# @return [FlagBuilderV2] the flag builder
#
def value_for_all(value)
variations(value).variation_for_all(0)
variations(value).variation_for_all(0).off_variation(0)
end

#
Expand Down
11 changes: 11 additions & 0 deletions spec/integrations/test_data_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ module Integrations
expect(init_data[:segments][:mysegment][:included]).to eq(['user2'])
end

it 'returns the value_for_all value whether targeting is on or off' do
td = TestDataV2.data_source
flag = td.flag('myflag').value_for_all('x').build(1)
expect(flag[:variations]).to eq(['x'])
expect(flag[:fallthrough]).to eq({ variation: 0 })
expect(flag[:offVariation]).to eq(0)

off_flag = td.flag('myflag').value_for_all('x').on(false).build(1)
expect(off_flag[:offVariation]).to eq(0)
end

describe 'TestDataSourceV2' do
it 'includes both flags and segments in fetch' do
td = TestDataV2.data_source
Expand Down
Loading