mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
25 lines
609 B
Ruby
25 lines
609 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
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
|