Skip to content
Snippets Groups Projects
Commit ff217db7 authored by Dore, Kieran D (UG - Comp Sci & Elec Eng)'s avatar Dore, Kieran D (UG - Comp Sci & Elec Eng)
Browse files

Amended tests relevant to getting views whilst logged in

parent d5279bd0
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
-# Buttons to toggle the login form and the new account form
.login
.loginOptions
%button.button1#loginButton{onclick: "showLoginForm();"}= t('.login')
%button.button1#loginButton{onclick: "showLoginForm();"}= t('.login_button')
%button.button1#createButton{onclick: "showCreateForm();"}= t('.new_acc')
%br
......
......@@ -67,6 +67,7 @@ en:
title: Listify
page_title: Login
new_acc: Create new account
login_button: Login
email: Email
name: Name
password: Password
......
......@@ -29,7 +29,5 @@ class ContactControllerTest < ActionDispatch::IntegrationTest
post sendmessage_path, params: {email: 'email@address.com', message: ''} # Incorrect
assert_redirected_to contact_path
end
end
......@@ -2,7 +2,13 @@ require 'test_helper'
class HomeControllerTest < ActionDispatch::IntegrationTest
test 'should get home' do
post new_acc_path, params: {name: 'Ben', email: 'email@address.com', password: 'bing'}
get homepage_path
assert_response :redirect
assert_response :success
end
test 'should be logged in to get home' do
get homepage_path
assert_redirected_to root_path
end
end
......@@ -3,8 +3,14 @@ require 'test_helper'
class ListviewControllerTest < ActionDispatch::IntegrationTest
test 'should get listview' do
post new_acc_path, params: {name: 'Ben', email: 'email@address.com', password: 'bing'}
get listview_path params: {list_id: List.first.id}
assert_response :redirect
assert_response :success
end
test 'should be logged in to get listview' do
get listview_path
assert_redirected_to root_path
end
test 'new product quantity should be empty or greater than 0' do
......
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