mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
23 lines
586 B
Ruby
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
|