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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23a6fdcd5f1b67431256167313393d291f8fee97bc268613001ef7a37029f6ee
4
- data.tar.gz: 242af09dc73d8a226b2c828ffcb502e795c4e26bcdfc634c5323bc69d70e0b34
3
+ metadata.gz: '074907fd1547c28975f5e7d269aa34374845776543d8d41bb3b567170558a7e8'
4
+ data.tar.gz: 6f3363751f0159cf834e783310c5415a74cb3ba4cf664e5fe004a43f110b91c6
5
5
  SHA512:
6
- metadata.gz: d6f44d258da32511754111633d95a81c50fe6e821228594814e0338ae7b82ca85594bda87dc2ef104dcd09e8d98c5327c4b3ab4fe64fb204d6469b8ae77ddaf2
7
- data.tar.gz: a2dabbc91a032794984a25e7940e9272ddfac9eacaae83a4e97b8bac5eae6a606e8c29a923b08e3543237990253bcd7e7fe2e1c63d2efb18fce2e9a9408a9891
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 'rails-integration-test-generator'
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.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ControllerIntegrationTestUnit
3
+ module IntegrationTestUnit
4
4
  class ControllerGenerator < Rails::Generators::NamedBase # :nodoc:
5
5
  source_root File.expand_path('templates', __dir__)
6
6
 
@@ -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 :controller_integration_test_unit, fixture: false
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.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/controller_integration_test_unit/controller/controller_generator.rb
70
- - lib/generators/controller_integration_test_unit/controller/templates/functional_test.rb.tt
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: