Skip to content
Snippets Groups Projects
Commit dc1d0e1e authored by Butler, Alexis (UG - Computer Science)'s avatar Butler, Alexis (UG - Computer Science)
Browse files

first couple product admin controller tests

parent f6b49a8a
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment