spec/flipper/api/v1/actions/actors_gate_spec.rb in flipper-api-0.21.0 vs spec/flipper/api/v1/actions/actors_gate_spec.rb in flipper-api-0.22.0
- old
+ new
@@ -42,17 +42,35 @@
end
end
describe 'enable feature with slash in name' do
before do
- flipper[:my_feature].disable_actor(actor)
+ flipper["my/feature"].disable_actor(actor)
post '/features/my/feature/actors', flipper_id: actor.flipper_id
end
it 'enables feature for actor' do
expect(last_response.status).to eq(200)
expect(flipper["my/feature"].enabled?(actor)).to be_truthy
expect(flipper["my/feature"].enabled_gate_names).to eq([:actor])
+ end
+
+ it 'returns decorated feature with actor enabled' do
+ gate = json_response['gates'].find { |gate| gate['key'] == 'actors' }
+ expect(gate['value']).to eq(['1'])
+ end
+ end
+
+ describe 'enable feature with space in name' do
+ before do
+ flipper["sp ace"].disable_actor(actor)
+ post '/features/sp%20ace/actors', flipper_id: actor.flipper_id
+ end
+
+ it 'enables feature for actor' do
+ expect(last_response.status).to eq(200)
+ expect(flipper["sp ace"].enabled?(actor)).to be_truthy
+ expect(flipper["sp ace"].enabled_gate_names).to eq([:actor])
end
it 'returns decorated feature with actor enabled' do
gate = json_response['gates'].find { |gate| gate['key'] == 'actors' }
expect(gate['value']).to eq(['1'])