Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
require 'rails_helper'
RSpec.describe Admin::ApplicationController, type: :controller do
controller do
def new
authorize Account
render plain: "Hello world"
end
end
it "allows admin users" do
admin = create(:user, :admin)
sign_in(admin)
get :new
expect(response).to be_successful
end
it "redirects non-admin users" do
non_admin = create(:user, admin: false)
sign_in(non_admin)
get :new
expect(response).to be_redirect
end
end