Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Com2025-Coursework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Butler, Alexis (UG - Computer Science)
Com2025-Coursework
Commits
dc1d0e1e
Commit
dc1d0e1e
authored
4 years ago
by
Butler, Alexis (UG - Computer Science)
Browse files
Options
Downloads
Patches
Plain Diff
first couple product admin controller tests
parent
f6b49a8a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/controllers/admin/products_controller_test.rb
+26
-5
26 additions, 5 deletions
test/controllers/admin/products_controller_test.rb
with
26 additions
and
5 deletions
test/controllers/admin/products_controller_test.rb
+
26
−
5
View file @
dc1d0e1e
require
'test_helper'
#TODO:
write
product admin tests
#TODO:
finish
product admin tests
class
Admin::ProductsControllerTest
<
ActionDispatch
::
IntegrationTest
test
"should get index"
do
test
'should get table of all products'
do
sign_in_as_admin
get
admin_products_url
assert_response
(
:success
)
assert_select
'body.products'
do
assert_select
'a.btn.btn-sm.btn-danger'
,
Product
.
count
end
end
test
'should not get prod table if not admin'
do
sign_in_as_tester
get
admin_products_url
assert_response
(
:redirect
)
assert_redirected_to
(
root_url
)
assert_equal
'You must be admin to go there!'
,
flash
[
:danger
]
end
test
'should get new product form'
do
end
test
'should not get new prod form if not admin'
do
test
"should get create"
do
end
test
'should create a new product'
do
test
"should get new"
do
end
test
'should not create a new product if not admin'
do
test
"should get destroy"
do
end
test
'should delete a product'
do
end
test
'should not delete a product if not admin'
do
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