test-unit-rails 5.1.3 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 79ee51ae87ad9c05762e48ea6770964644dbbed4
4
- data.tar.gz: 408e835e79a633fb0bc87c323b01d0b4cc824317
2
+ SHA256:
3
+ metadata.gz: 3092b59d0d4d94ccfe695229529c9b7c836f83d5e245fc62346bef7a0bc8b6c6
4
+ data.tar.gz: 82da852f72408c0c1b186056b2df3ff68bca4a1a8cd00171da7141fccc8b5af4
5
5
  SHA512:
6
- metadata.gz: 499feda1eb7a22c384ee7bbc680c424052bd17ba29a40ae6bc5f4008ec91022a15b1262d477c862c5ea2d49c8810c1f85e55a9e865d4c61ff82c4a5cc9233c41
7
- data.tar.gz: e13ec72923875f4e1e52eafc7397d000eafe6305751df88d414b7bfb55dfa3f93861d49954f3036c371f5dd013132b68fe7819c286ab036f84da7e2fb89386e7
6
+ metadata.gz: d588ccca5c624004b06b557ee33652b0938bff87f592eb5dd8d46b3d28ded3a5c72dada531450f12c890253fc7078dfbab156176fccd050530f55c80255761ee
7
+ data.tar.gz: c26279c2926b3127ea130ae5cb87128a2110205037887b1ebce05c8ed181ed7f1b1e936c30d2a5fd697c6a9a67b904504f49ee16f1958033a2a4f880c1c16f08
data/Rakefile CHANGED
@@ -27,6 +27,7 @@ require 'packnga'
27
27
  task :default => :test
28
28
 
29
29
  base_dir = File.join(File.dirname(__FILE__))
30
+ html_base_dir = File.join(base_dir, "doc", "html")
30
31
 
31
32
  class Bundler::GemHelper
32
33
  def version_tag
@@ -48,6 +49,13 @@ document_task = Packnga::DocumentTask.new(spec) do |task|
48
49
  end
49
50
 
50
51
  Packnga::ReleaseTask.new(spec) do |task|
52
+ test_unit_github_io_dir_candidates = [
53
+ "../../www/test-unit.github.io",
54
+ ]
55
+ test_unit_github_io_dir = test_unit_github_io_dir_candidates.find do |dir|
56
+ File.directory?(dir)
57
+ end
58
+ task.index_html_dir = test_unit_github_io_dir
51
59
  end
52
60
 
53
61
  desc "Run test"
@@ -1,5 +1,16 @@
1
1
  # News
2
2
 
3
+ ## 5.2.1 - 2018-08-10 {#version-5-2-1}
4
+
5
+ ### Improvements
6
+
7
+ * Added support for `ActionDispatch::SystemTestCase`.
8
+ [GitHub#21][Patch by okkez]
9
+
10
+ ### Thanks
11
+
12
+ * okkez
13
+
3
14
  ## 5.1.3 - 2017-07-28 {#version-5-1-3}
4
15
 
5
16
  ### Improvements
@@ -7,7 +18,7 @@
7
18
  * Removed test-unit-notify dependency.
8
19
 
9
20
  * Added `test:system` task support.
10
- [GitHub:17][Patch by naofumi-fujii]
21
+ [GitHub#17][Patch by naofumi-fujii]
11
22
 
12
23
  ### Thanks
13
24
 
@@ -38,6 +38,7 @@ require "active_support/testing/constant_lookup"
38
38
  require "action_controller"
39
39
  require "action_controller/test_case"
40
40
  require "action_dispatch/testing/integration"
41
+ require "action_dispatch/system_test_case"
41
42
 
42
43
  if defined?(ActiveRecord::Migration)
43
44
  if ActiveRecord::Migration.respond_to?(:maintain_test_schema!)
@@ -86,3 +87,15 @@ class ActionDispatch::IntegrationTest
86
87
  end
87
88
  include Capybara::DSL
88
89
  end
90
+
91
+ class ActionDispatch::SystemTestCase
92
+ setup before: :prepend do
93
+ self.class.driver.use
94
+ end
95
+
96
+ # take screenshot before reset session
97
+ teardown after: :prepend do
98
+ take_failed_screenshot
99
+ Capybara.reset_sessions!
100
+ end
101
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2018 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
17
17
  module Test
18
18
  module Unit
19
19
  module Rails
20
- VERSION = "5.1.3"
20
+ VERSION = "5.2.1"
21
21
  end
22
22
  end
23
23
  end
@@ -21,17 +21,22 @@ require "rails/all"
21
21
  # For Rack::Builder#to_app
22
22
  module TestUnitRails
23
23
  class Application < ::Rails::Application
24
+ ::Rails.logger = config.logger = ActiveSupport::Logger.new($stdout)
24
25
  end
25
26
  end
26
27
 
27
28
  require "test/unit/rails/test_help"
29
+ require "selenium-webdriver"
28
30
 
29
31
  Rails.application.secrets[:secret_key_base] = 'xxx'
30
32
  Rails.application.routes.draw do
31
33
  resources :items
32
34
  end
33
35
 
34
- class ItemsController
36
+ class ItemsController < ActionController::Base
37
+ def index
38
+ render plain: "Hello"
39
+ end
35
40
  end
36
41
 
37
42
  require "fileutils"
@@ -0,0 +1,18 @@
1
+ require "test_helper"
2
+
3
+ if ENV["TRAVIS"]
4
+ require "chromedriver/helper"
5
+ Chromedriver.set_version "2.35"
6
+ end
7
+
8
+ class TestSystemTestCase < ActionDispatch::SystemTestCase
9
+ driven_by :selenium, using: :headless_chrome, screen_size: [1920, 1080]
10
+
11
+ test "render text" do
12
+ assert_equal(:selenium, Capybara.current_driver)
13
+ browser = self.class.driver.instance_variable_get(:@browser)
14
+ assert_equal(:chrome, browser.type)
15
+ visit("/items")
16
+ assert_text("Hello")
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-unit-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.3
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -150,6 +150,48 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: puma
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: selenium-webdriver
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: chromedriver-helper
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
153
195
  description: 'Rails supports Minitest but doesn''t support test-unit.
154
196
 
155
197
  '
@@ -174,6 +216,7 @@ files:
174
216
  - test/test_action_controller.rb
175
217
  - test/test_action_dispatch.rb
176
218
  - test/test_helper.rb
219
+ - test/test_system_test_case.rb
177
220
  homepage: https://github.com/test-unit/test-unit-rails
178
221
  licenses:
179
222
  - LGPLv2 or later
@@ -194,14 +237,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
237
  version: '0'
195
238
  requirements: []
196
239
  rubyforge_project:
197
- rubygems_version: 2.5.2
240
+ rubygems_version: 3.0.0.beta1
198
241
  signing_key:
199
242
  specification_version: 4
200
243
  summary: test-unit-rails is a Rails adapter for test-unit gem. You can use full test-unit
201
244
  gem features, [RR](https://rubygems.org/gems/rr) integration and [Capybara](https://rubygems.org/gems/capybara)
202
245
  integration with test-unit-rails.
203
246
  test_files:
247
+ - test/test_system_test_case.rb
204
248
  - test/test_action_controller.rb
205
249
  - test/run-test.rb
206
- - test/test_helper.rb
207
250
  - test/test_action_dispatch.rb
251
+ - test/test_helper.rb