rails-integration-test-generator 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +45 -1
- data/lib/generators/{controller_integration_test_unit → integration_test_unit}/controller/controller_generator.rb +1 -1
- data/lib/rails-integration-test-generator.rb +1 -1
- metadata +3 -9
- /data/lib/generators/{controller_integration_test_unit → integration_test_unit}/controller/templates/functional_test.rb.tt +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '074907fd1547c28975f5e7d269aa34374845776543d8d41bb3b567170558a7e8'
|
|
4
|
+
data.tar.gz: 6f3363751f0159cf834e783310c5415a74cb3ba4cf664e5fe004a43f110b91c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd4c7c4a1930cac04cc060242a3755503374398736444e7b4a7bc2e8fef5514fa261a2c1649dfe9b7018c8457e588e83f33e52d4b5afead115dd3f0edb0b3eb1
|
|
7
|
+
data.tar.gz: 84e9f53898e09ad56f2bf6289ba495e7e62b8df2f8d029882f8e126b056c52d54755e56af2d71e4a1601cf609ae9a18419aa13a0ae0f450fa73715e87d63c312
|
data/README.md
CHANGED
|
@@ -8,13 +8,57 @@ rails-integration-test generator overrides the controller generator to generate
|
|
|
8
8
|
Just add this to your gemfile:
|
|
9
9
|
|
|
10
10
|
```ruby
|
|
11
|
-
gem
|
|
11
|
+
gem "rails-integration-test-generator"
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
This gem has been tested with Rails versions 7.0-8.1
|
|
15
15
|
|
|
16
16
|
Evertyime a controller is generated, an integration test will automatically be generated along with it.
|
|
17
17
|
|
|
18
|
+
For example, running the following command:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
rails generate controller Things
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
will result in a things_test.rb file being generated in the test/integration folder with the following contents:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
require "test_helper"
|
|
28
|
+
|
|
29
|
+
class ThingsTest < ActionDispatch::IntegrationTest
|
|
30
|
+
# test "the truth" do
|
|
31
|
+
# assert true
|
|
32
|
+
# end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Generating a controller with action names like this
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
rails generate controller Things action1 action2
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
will result in a file with the following contents:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
require "test_helper"
|
|
47
|
+
|
|
48
|
+
class ThingsTest < ActionDispatch::IntegrationTest
|
|
49
|
+
test "successfully load action1" do
|
|
50
|
+
get things_action1_url
|
|
51
|
+
assert_response :success
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
test "successfully load action2" do
|
|
55
|
+
get things_action2_url
|
|
56
|
+
assert_response :success
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
18
62
|
## Rationale
|
|
19
63
|
|
|
20
64
|
Naming integration tests as controller tests is confusing and obscures their actual purpose, which is to test if various parts of an application integrate successfully.
|
|
@@ -6,7 +6,7 @@ module RailsIntegrationTestGenerator
|
|
|
6
6
|
module Rails
|
|
7
7
|
class Railtie < ::Rails::Railtie # :nodoc:
|
|
8
8
|
config.app_generators do |g|
|
|
9
|
-
g.test_framework :
|
|
9
|
+
g.test_framework :integration_test_unit, fixture: false
|
|
10
10
|
g.fallbacks[:controller_integration_test_unit] = :test_unit
|
|
11
11
|
end
|
|
12
12
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-integration-test-generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrick McSweeny
|
|
@@ -16,9 +16,6 @@ dependencies:
|
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
18
|
version: '7.0'
|
|
19
|
-
- - "<="
|
|
20
|
-
- !ruby/object:Gem::Version
|
|
21
|
-
version: '8.1'
|
|
22
19
|
type: :runtime
|
|
23
20
|
prerelease: false
|
|
24
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -26,9 +23,6 @@ dependencies:
|
|
|
26
23
|
- - ">="
|
|
27
24
|
- !ruby/object:Gem::Version
|
|
28
25
|
version: '7.0'
|
|
29
|
-
- - "<="
|
|
30
|
-
- !ruby/object:Gem::Version
|
|
31
|
-
version: '8.1'
|
|
32
26
|
- !ruby/object:Gem::Dependency
|
|
33
27
|
name: rails
|
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,8 +60,8 @@ extra_rdoc_files: []
|
|
|
66
60
|
files:
|
|
67
61
|
- LICENSE
|
|
68
62
|
- README.md
|
|
69
|
-
- lib/generators/
|
|
70
|
-
- lib/generators/
|
|
63
|
+
- lib/generators/integration_test_unit/controller/controller_generator.rb
|
|
64
|
+
- lib/generators/integration_test_unit/controller/templates/functional_test.rb.tt
|
|
71
65
|
- lib/rails-integration-test-generator.rb
|
|
72
66
|
homepage: https://github.com/PatrickMcSweeny/rails-integration-test-generator
|
|
73
67
|
licenses:
|