2019-10-21 22:57:48 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe AboutController, type: :controller do
|
|
|
|
it "renders the staff template" do
|
|
|
|
get :staff
|
|
|
|
expect(response).to render_template("staff")
|
|
|
|
end
|
|
|
|
|
2020-03-15 07:53:52 +00:00
|
|
|
context 'as an admin' do
|
2020-03-15 13:33:58 +00:00
|
|
|
let!(:admin) { create(:user, :admin) }
|
2020-03-15 07:53:52 +00:00
|
|
|
|
|
|
|
before do
|
2020-03-15 13:33:58 +00:00
|
|
|
login_admin
|
2020-03-15 07:53:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "renders the adminpanel template" do
|
|
|
|
get :adminpanel
|
|
|
|
expect(response).to render_template("adminpanel")
|
|
|
|
end
|
2019-10-21 22:57:48 +00:00
|
|
|
|
2020-03-15 07:53:52 +00:00
|
|
|
it "renders the statistics template" do
|
|
|
|
get :statistics
|
|
|
|
expect(response).to render_template("statistics")
|
|
|
|
end
|
2019-10-21 22:57:48 +00:00
|
|
|
end
|
|
|
|
end
|