Links, mainly...
This commit is contained in:
parent
fd42a3f173
commit
21ab02d647
69 changed files with 2258 additions and 155 deletions
|
|
@ -17,7 +17,7 @@ class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create checklist" do
|
||||
assert_difference("Checklist.count") do
|
||||
post checklists_url, params: { checklist: { code: @checklist.code, description: @checklist.description, name: @checklist.name } }
|
||||
post checklists_url, params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to checklist_url(Checklist.last)
|
||||
|
|
@ -34,7 +34,7 @@ class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update checklist" do
|
||||
patch checklist_url(@checklist), params: { checklist: { code: @checklist.code, description: @checklist.description, name: @checklist.name } }
|
||||
patch checklist_url(@checklist), params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
||||
assert_redirected_to checklist_url(@checklist)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class ChecksControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_difference('Check.count') do
|
||||
post checks_url,
|
||||
params: { check: { level: @check.level, name: @check.name, position: @check.position,
|
||||
success_criterion: @check.success_criterion } }
|
||||
success_criterion_html: @check.success_criterion_html } }
|
||||
end
|
||||
|
||||
assert_redirected_to check_url(Check.last)
|
||||
|
|
@ -38,7 +38,7 @@ class ChecksControllerTest < ActionDispatch::IntegrationTest
|
|||
test 'should update check' do
|
||||
patch check_url(@check),
|
||||
params: { check: { level: @check.level, name: @check.name, position: @check.position,
|
||||
success_criterion: @check.success_criterion } }
|
||||
success_criterion_html: @check.success_criterion_html } }
|
||||
assert_redirected_to check_url(@check)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
test 'should create element' do
|
||||
assert_difference('Element.count') do
|
||||
post elements_url,
|
||||
params: { element: { description: @element.description, path: @element.path, report_id: @element.report_id,
|
||||
params: { element: { description_html: @element.description_html, path: @element.path, report_id: @element.report_id,
|
||||
title: @element.title, checklist_id: @checklist.id } }
|
||||
end
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test 'should update element' do
|
||||
patch element_url(@element),
|
||||
params: { element: { description: @element.description, path: @element.path, report_id: @element.report_id,
|
||||
params: { element: { description_html: @element.description_html, path: @element.path, report_id: @element.report_id,
|
||||
title: @element.title } }
|
||||
assert_redirected_to element_url(@element)
|
||||
end
|
||||
|
|
|
|||
49
test/controllers/link_categories_controller_test.rb
Normal file
49
test/controllers/link_categories_controller_test.rb
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
require "test_helper"
|
||||
|
||||
class LinkCategoriesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@link_category = link_categories(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get link_categories_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_link_category_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create link_category" do
|
||||
assert_difference("LinkCategory.count") do
|
||||
post link_categories_url, params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to link_category_url(LinkCategory.last)
|
||||
end
|
||||
|
||||
test "should show link_category" do
|
||||
get link_category_url(@link_category)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_link_category_url(@link_category)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update link_category" do
|
||||
patch link_category_url(@link_category), params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
assert_redirected_to link_category_url(@link_category)
|
||||
end
|
||||
|
||||
test "should destroy link_category" do
|
||||
assert_difference("LinkCategory.count", -1) do
|
||||
link_category = link_categories(:deletable)
|
||||
delete link_category_url(link_category)
|
||||
end
|
||||
|
||||
assert_redirected_to link_categories_url
|
||||
end
|
||||
end
|
||||
48
test/controllers/links_controller_test.rb
Normal file
48
test/controllers/links_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class LinksControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@link = links(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get links_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_link_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create link" do
|
||||
assert_difference("Link.count") do
|
||||
post links_url, params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at, link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
end
|
||||
|
||||
assert_redirected_to link_url(Link.last)
|
||||
end
|
||||
|
||||
test "should show link" do
|
||||
get link_url(@link)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_link_url(@link)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update link" do
|
||||
patch link_url(@link), params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at, link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
assert_redirected_to link_url(@link)
|
||||
end
|
||||
|
||||
test "should destroy link" do
|
||||
assert_difference("Link.count", -1) do
|
||||
delete link_url(@link)
|
||||
end
|
||||
|
||||
assert_redirected_to links_url
|
||||
end
|
||||
end
|
||||
|
|
@ -17,7 +17,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create report" do
|
||||
assert_difference("Report.count") do
|
||||
post reports_url, params: { report: { comment: @report.comment, name: @report.name } }
|
||||
post reports_url, params: { report: { comment_html: @report.comment_html, name: @report.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to report_url(Report.last)
|
||||
|
|
@ -34,7 +34,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update report" do
|
||||
patch report_url(@report), params: { report: { comment: @report.comment, name: @report.name } }
|
||||
patch report_url(@report), params: { report: { comment_html: @report.comment_html, name: @report.name } }
|
||||
assert_redirected_to report_url(@report)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create success_criterion" do
|
||||
assert_difference("SuccessCriterion.count") do
|
||||
post success_criteria_url, params: { success_criterion: { comment: @success_criterion.comment, description: @success_criterion.description, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
post success_criteria_url, params: { success_criterion: { comment_html: @success_criterion.comment_html, description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
end
|
||||
|
||||
assert_redirected_to success_criterion_url(SuccessCriterion.last)
|
||||
|
|
@ -34,7 +34,7 @@ class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update success_criterion" do
|
||||
patch success_criterion_url(@success_criterion), params: { success_criterion: { comment: @success_criterion.comment, description: @success_criterion.description, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
patch success_criterion_url(@success_criterion), params: { success_criterion: { comment_html: @success_criterion.comment_html, description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
assert_redirected_to success_criterion_url(@success_criterion)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue