Skip to content

Commit 66921b6

Browse files
authored
Generate the app's RequestTest class (#10)
Update `test/support/requests.rb` to define a top-level `RequestTest` that the app's request tests can inherit from. This makes the code match the README, where it instructs users to inherit from `RequestTest` when adding new request tests.
1 parent e3811c7 commit 66921b6

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
1717

1818
### Fixed
1919

20+
- Generate `FeatureTest` and `RequestTest` classes so feature and request tests work as expected without configuration. (@mddelk in #9, #10)
21+
2022
### Security
2123

2224
[Unreleased]: https://github.com/hanami/hanami-minitest/compare/v3.0.0...HEAD

lib/hanami/minitest/generators/templates/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "test_helper"
44

5-
class RootTest < Hanami::Minitest::RequestTest
5+
class RootTest < RequestTest
66
test "not found" do
77
get "/"
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

3-
class Hanami::Minitest::RequestTest
3+
class RequestTest < Hanami::Minitest::RequestTest
44
# Add custom request test helpers here.
55
end

test/unit/commands/install_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def setup
216216
support_requests = <<~EXPECTED
217217
# frozen_string_literal: true
218218
219-
class Hanami::Minitest::RequestTest
219+
class RequestTest < Hanami::Minitest::RequestTest
220220
# Add custom request test helpers here.
221221
end
222222
EXPECTED
@@ -228,7 +228,7 @@ class Hanami::Minitest::RequestTest
228228
229229
require "test_helper"
230230
231-
class RootTest < Hanami::Minitest::RequestTest
231+
class RootTest < RequestTest
232232
test "not found" do
233233
get "/"
234234

0 commit comments

Comments
 (0)