Files
openfoodnetwork/spec/requests/admin/enterprises_controller_spec.rb
Maikel Linke dcb6f4676d Remove all unnecessary spec_helper require statements
The `.rspec` file is doing this for us.
2026-01-21 12:35:34 +11:00

23 lines
586 B
Ruby

# frozen_string_literal: true
RSpec.describe Admin::EnterprisesController do
let(:admin) { create(:admin_user) }
let(:enterprise) { create(:enterprise) }
before do
sign_in admin
end
describe 'GET #show' do
it 'returns a successful response' do
get edit_admin_enterprise_path(enterprise)
expect(response).to have_http_status(:success)
end
it "redirect to the enterprises page for non-existing enterprise" do
get edit_admin_enterprise_path(id: 'non-existing')
expect(response).to redirect_to(admin_enterprises_path)
end
end
end