start of iteration 2
This commit is contained in:
parent
9fb87a74ce
commit
729ed13521
75 changed files with 705 additions and 170 deletions
48
test/controllers/pages_controller_test.rb
Normal file
48
test/controllers/pages_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class PagesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@page = pages(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get pages_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_page_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create page" do
|
||||
assert_difference("Page.count") do
|
||||
post pages_url, params: { page: { path: @page.path, position: @page.position, report_id: @page.report_id, url: @page.url } }
|
||||
end
|
||||
|
||||
assert_redirected_to page_url(Page.last)
|
||||
end
|
||||
|
||||
test "should show page" do
|
||||
get page_url(@page)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_page_url(@page)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update page" do
|
||||
patch page_url(@page), params: { page: { path: @page.path, position: @page.position, report_id: @page.report_id, url: @page.url } }
|
||||
assert_redirected_to page_url(@page)
|
||||
end
|
||||
|
||||
test "should destroy page" do
|
||||
assert_difference("Page.count", -1) do
|
||||
delete page_url(@page)
|
||||
end
|
||||
|
||||
assert_redirected_to pages_url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue