spec/flipper/api/v1/actions/feature_spec.rb in flipper-api-0.14.0 vs spec/flipper/api/v1/actions/feature_spec.rb in flipper-api-0.15.0

- old
+ new

@@ -107,9 +107,53 @@ 'more_info' => api_error_code_reference_url, } expect(json_response).to eq(expected) end end + + context 'feature with name that ends in "features"' do + before do + flipper[:search_features].enable + get '/features/search_features' + end + + it 'responds with correct attributes' do + response_body = { + 'key' => 'search_features', + 'state' => 'on', + 'gates' => [ + { + 'key' => 'boolean', + 'name' => 'boolean', + 'value' => 'true', + }, + { + 'key' => 'groups', + 'name' => 'group', + 'value' => [], + }, + { + 'key' => 'actors', + 'name' => 'actor', + 'value' => [], + }, + { + 'key' => 'percentage_of_actors', + 'name' => 'percentage_of_actors', + 'value' => nil, + }, + { + 'key' => 'percentage_of_time', + 'name' => 'percentage_of_time', + 'value' => nil, + }, + ], + } + + expect(last_response.status).to eq(200) + expect(json_response).to eq(response_body) + end + end end describe 'delete' do context 'succesful request' do it 'deletes feature' do