A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -1,4 +1,6 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ElementsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
|
|
@ -6,18 +8,18 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
@checklist = checklists(:one)
|
||||
end
|
||||
|
||||
test 'should get index' do
|
||||
test "should get index" do
|
||||
get elements_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get new' do
|
||||
test "should get new" do
|
||||
get new_element_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should create element' do
|
||||
assert_difference('Element.count') do
|
||||
test "should create element" do
|
||||
assert_difference("Element.count") do
|
||||
post elements_url,
|
||||
params: { element: { description_html: @element.description_html, path: @element.path, report_id: @element.report_id,
|
||||
title: @element.title, checklist_id: @checklist.id } }
|
||||
|
|
@ -26,25 +28,25 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_redirected_to report_url(Element.last.report)
|
||||
end
|
||||
|
||||
test 'should show element' do
|
||||
test "should show element" do
|
||||
get element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get edit' do
|
||||
test "should get edit" do
|
||||
get edit_element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should update element' do
|
||||
test "should update element" do
|
||||
patch element_url(@element),
|
||||
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
|
||||
|
||||
test 'should destroy element' do
|
||||
assert_difference('Element.count', -1) do
|
||||
test "should destroy element" do
|
||||
assert_difference("Element.count", -1) do
|
||||
delete element_url(@element)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue