Links, mainly...
This commit is contained in:
parent
fd42a3f173
commit
21ab02d647
69 changed files with 2258 additions and 155 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue