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/reports_controller_test.rb
Normal file
48
test/controllers/reports_controller_test.rb
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
require "test_helper"
|
||||
|
||||
class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@report = reports(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get reports_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_report_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create report" do
|
||||
assert_difference("Report.count") do
|
||||
post reports_url, params: { report: { comment: @report.comment, name: @report.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to report_url(Report.last)
|
||||
end
|
||||
|
||||
test "should show report" do
|
||||
get report_url(@report)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get edit_report_url(@report)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update report" do
|
||||
patch report_url(@report), params: { report: { comment: @report.comment, name: @report.name } }
|
||||
assert_redirected_to report_url(@report)
|
||||
end
|
||||
|
||||
test "should destroy report" do
|
||||
assert_difference("Report.count", -1) do
|
||||
delete report_url(@report)
|
||||
end
|
||||
|
||||
assert_redirected_to reports_url
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue