require 'helper' RSpec.describe Flipper::UI::Actions::GroupsGate do let(:token) do if Rack::Protection::AuthenticityToken.respond_to?(:random_token) Rack::Protection::AuthenticityToken.random_token else 'a' end end let(:session) do { :csrf => token, 'csrf' => token, '_csrf_token' => token } end describe 'GET /features/:feature/groups' do before do Flipper.register(:admins, &:admin?) get 'features/search/groups' end after do Flipper.unregister_groups end it 'responds with success' do expect(last_response.status).to be(200) end it 'renders add new group form' do form = '