Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
48
test/controllers/elements_controller_test.rb
Normal file
48
test/controllers/elements_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class ElementsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@element = elements(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get elements_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_element_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
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, title: @element.title } }
|
||||
end
|
||||
|
||||
assert_redirected_to element_url(Element.last)
|
||||
end
|
||||
|
||||
test "should show element" do
|
||||
get element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update element" do
|
||||
patch element_url(@element), params: { element: { description: @element.description, 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
|
||||
delete element_url(@element)
|
||||
end
|
||||
|
||||
assert_redirected_to elements_url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue