rails-controller-testing 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: c62fa8d9d566950fb4dabf54650920b31a7e255b
4
- data.tar.gz: 328b13f082656d996ef0efa9452cd58f1b78428a
3
+ metadata.gz: 1985518a366c6d03e6ee96cc506686ac0c2d965d
4
+ data.tar.gz: 97d894de1d866047e6b8fc0d6055b17f91f7d48c
5
5
  SHA512:
6
- metadata.gz: ff9b2f9b07c5b4658ecd4d39245a01e5af0fc401f58d02de7ec9791d23d9425ede8915a27572735cc0a5361b151dbe5cee2339ca913f33988dac9bed28300c39
7
- data.tar.gz: 58cc294970673954c53aff30134b34c228eab30afd952f0469e861b7601df4dded68ce9e8dde21b49cb59df70b360a97e8e6318ac7775a4fee236b25d279e0b0
6
+ metadata.gz: 54709c6e0bf1f97d9d35e8c613b6f7990a8e11541601b5f16296604d6a3b4e0ee2c86e6a7f4214bcbb54ecc0f5364bec7d670712a45d85694dbe3671062578ac
7
+ data.tar.gz: fb983705ffd31ccdc5d93c5b2ebcc478bc08cc2a2bde8d98a8c13068219879f4fbb5716012440de89c7f6323a129cdb2371d1aa37c8f43d3b14d75a776fdc7d4
data/README.md CHANGED
@@ -1,8 +1,5 @@
1
1
  # Rails::Controller::Testing
2
2
 
3
- [![Build Status](https://travis-ci.org/rails/rails-controller-testing.svg?branch=master)](https://travis-ci.org/rails/rails-controller-testing)
4
- [![Gem Version](https://badge.fury.io/rb/rails-controller-testing.svg)](http://badge.fury.io/rb/rails-controller-testing)
5
-
6
3
  This gem brings back `assigns` to your controller tests as well as `assert_template`
7
4
  to both controller and integration tests.
8
5
 
@@ -43,6 +40,19 @@ RSpec.configure do |config|
43
40
  end
44
41
  ```
45
42
 
43
+ ## Outside Rails
44
+
45
+ For projects and gems using controller tests outside of a Rails application,
46
+ invoke the `Rails::Controller::Testing.install` method inside your test suite
47
+ setup to include the required modules on controller test cases.
48
+
49
+ ```ruby
50
+ # test/test_helper.rb
51
+
52
+ require 'rails-controller-testing'
53
+ Rails::Controller::Testing.install
54
+ ```
55
+
46
56
  ## Usage
47
57
 
48
58
  ### assigns
@@ -1,22 +1,3 @@
1
- require 'active_support/lazy_load_hooks'
2
- require 'rails/controller/testing/test_process'
3
- require 'rails/controller/testing/integration'
4
- require 'rails/controller/testing/template_assertions'
1
+ require 'rails/controller/testing'
2
+ require 'rails/controller/testing/railtie' if defined?(Rails::Railtie)
5
3
  require 'rails/controller/testing/version'
6
-
7
- class Rails::Controller::Testing::Railtie < Rails::Railtie
8
- initializer "rails_controller_testing" do
9
- ActiveSupport.on_load(:action_controller) do
10
- ActionController::TestCase.include Rails::Controller::Testing::TestProcess
11
- ActionController::TestCase.include Rails::Controller::Testing::TemplateAssertions
12
-
13
- ActionDispatch::IntegrationTest.include Rails::Controller::Testing::TemplateAssertions
14
- ActionDispatch::IntegrationTest.include Rails::Controller::Testing::Integration
15
- ActionDispatch::IntegrationTest.include Rails::Controller::Testing::TestProcess
16
- end
17
-
18
- ActiveSupport.on_load(:action_view) do
19
- ActionView::TestCase.include Rails::Controller::Testing::TemplateAssertions
20
- end
21
- end
22
- end
@@ -0,0 +1,25 @@
1
+ require 'active_support/lazy_load_hooks'
2
+ require 'rails/controller/testing/test_process'
3
+ require 'rails/controller/testing/integration'
4
+ require 'rails/controller/testing/template_assertions'
5
+
6
+ module Rails
7
+ module Controller
8
+ module Testing
9
+ def self.install
10
+ ActiveSupport.on_load(:action_controller) do
11
+ ActionController::TestCase.include Rails::Controller::Testing::TestProcess
12
+ ActionController::TestCase.include Rails::Controller::Testing::TemplateAssertions
13
+
14
+ ActionDispatch::IntegrationTest.include Rails::Controller::Testing::TemplateAssertions
15
+ ActionDispatch::IntegrationTest.include Rails::Controller::Testing::Integration
16
+ ActionDispatch::IntegrationTest.include Rails::Controller::Testing::TestProcess
17
+ end
18
+
19
+ ActiveSupport.on_load(:action_view) do
20
+ ActionView::TestCase.include Rails::Controller::Testing::TemplateAssertions
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,5 @@
1
+ class Rails::Controller::Testing::Railtie < Rails::Railtie
2
+ initializer "rails_controller_testing" do
3
+ Rails::Controller::Testing.install
4
+ end
5
+ end
@@ -1,7 +1,7 @@
1
1
  module Rails
2
2
  module Controller
3
3
  module Testing
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-controller-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Core Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -90,7 +90,9 @@ files:
90
90
  - README.md
91
91
  - Rakefile
92
92
  - lib/rails-controller-testing.rb
93
+ - lib/rails/controller/testing.rb
93
94
  - lib/rails/controller/testing/integration.rb
95
+ - lib/rails/controller/testing/railtie.rb
94
96
  - lib/rails/controller/testing/template_assertions.rb
95
97
  - lib/rails/controller/testing/test_process.rb
96
98
  - lib/rails/controller/testing/version.rb