Skip to content

Commit 3112145

Browse files
committed
Add stand alone index and create tests
This is beneficial if you want to make sure you didn't break anything without having to run 3k allocations 😁
1 parent b391b20 commit 3112145

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'test_helper'
2+
3+
class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
4+
test "create" do
5+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
6+
7+
document = Document.last
8+
assert_equal 'New things', document.title
9+
assert_equal 'Doing them', document.content
10+
end
11+
end
12+
13+
Minitest.run_one_method(DocumentsIntegrationTest, 'test_create')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require 'test_helper'
2+
3+
class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
4+
# standard test
5+
test "index" do
6+
get '/documents'
7+
assert_equal 200, response.status
8+
end
9+
end
10+
11+
Minitest.run_one_method(DocumentsIntegrationTest, 'test_index')

0 commit comments

Comments
 (0)