Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enote
dtu-enote-website
Commits
db88945a
Commit
db88945a
authored
6 years ago
by
Iain J. Bryson
Browse files
Options
Downloads
Patches
Plain Diff
remove unecessary file
parent
b9d1f830
Branches
devel
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
home_controller_spec.rb
+0
-43
0 additions, 43 deletions
home_controller_spec.rb
with
0 additions
and
43 deletions
home_controller_spec.rb
deleted
100644 → 0
+
0
−
43
View file @
b9d1f830
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment