Skip to content
Snippets Groups Projects
Commit db88945a authored by Iain J. Bryson's avatar Iain J. Bryson
Browse files

remove unecessary file

parent b9d1f830
Branches devel
No related tags found
No related merge requests found
require 'rails_helper'
RSpec.describe HomeController, type: :controller do
describe "GET #index" do
it "returns http success" do
get :index, params: { :course_id => @test_course_id }
expect(response).to have_http_status(:success)
end
end
describe "GET #index shows the admin menu" do
render_views
admin_user = DTUAuth2::CachedAuthorizationManager.user_by_id('testadmin')
author_user = DTUAuth2::CachedAuthorizationManager.user_by_id('testauthor')
student_user = DTUAuth2::CachedAuthorizationManager.user_by_id('teststudent')
before(:each) do
DTUAuth2::populate Rails.root.join("spec", "files", "config").to_s, Rails.root.join("spec", "files", "user_config").to_s
end
it "shows the admin menu item if the user is an admin" do
subject.send(:log_in, admin_user)
get :index, params: { :course_id => @test_course_id }
expect(response.body).to have_tag(:a, :text => "Admin", :href=>"/admin")
end
it "shows no admin menu item if the user is a student" do
subject.send(:log_in, student_user)
get :index, params: { :course_id => @test_course_id }
expect(response.body).to_not have_tag(:a, :text => "Admin", :href=>"/admin")
end
it "shows no admin menu item if the user is a author" do
subject.send(:log_in, author_user)
puts("AUTHOR: #{subject.my_groups}")
get :index, params: { :course_id => @test_course_id }
expect(response.body).to_not have_tag(:a, :text => "Admin", :href=>"/admin")
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment