rspec-rails 3.5.0.beta2 → 3.5.0.beta3
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +9 -1
- data/lib/generators/rspec/mailer/templates/preview.rb +1 -1
- data/lib/rspec/rails/version.rb +1 -1
- data/lib/rspec/rails/view_rendering.rb +53 -12
- metadata +14 -14
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd3e8920d7678a4b3f3686f66b288355451d1f8a
|
4
|
+
data.tar.gz: c19188976968aaeb94a84db58fd1e983142b67c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eedacf89d9f499df4f5025fc0e00160bf13534fd24e3cf0cf7c99a9a882731607a3d6f6c78fd03868bda779aea55eaf7155d03152bd2007628b52bb90cb568bb
|
7
|
+
data.tar.gz: 9b6cf8abb62ff3cb103441199ba88b0e26c990c3cb7ddb2446251376ed7efb17d4006f37f31b0b9bc448e60f6d7a4cf63363fbfb929bc906b7918ee91987914c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
### 3.5.0.development
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.5.0.beta3...master)
|
3
|
+
|
4
|
+
### 3.5.0.beta3 2016-04-02
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.5.0.beta1...v3.5.0.beta3)
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
* Add support for Rails 5 Beta 3 (Sam Phippen, Benjamin Quorning, Koen Punt, #1589, #1573)
|
3
9
|
|
4
10
|
Bug fxes:
|
5
11
|
|
6
12
|
* Make it possible to use floats in auto generated (scaffold) tests.
|
7
13
|
(Alwahsh, #1550)
|
14
|
+
* Support custom resolvers when preventing views from rendering.
|
15
|
+
(Jon Rowe, Benjamin Quorning, #1580)
|
8
16
|
|
9
17
|
### 3.5.0.beta1 2016-02-06
|
10
18
|
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.4.2...v3.5.0.beta1)
|
@@ -5,7 +5,7 @@ class <%= class_name %>Preview < ActionMailer::Preview
|
|
5
5
|
|
6
6
|
# Preview this email at http://localhost:3000/rails/mailers/<%= file_path %>/<%= action %>
|
7
7
|
def <%= action %>
|
8
|
-
<%= class_name %>.<%= action %>
|
8
|
+
<%= class_name %><%= Rails.version.to_f >= 5.0 ? "Mailer" : "" %>.<%= action %>
|
9
9
|
end
|
10
10
|
<% end -%>
|
11
11
|
|
data/lib/rspec/rails/version.rb
CHANGED
@@ -39,15 +39,18 @@ module RSpec
|
|
39
39
|
self.class.render_views? || !controller.class.respond_to?(:view_paths)
|
40
40
|
end
|
41
41
|
|
42
|
-
# Delegates find_all to the submitted path set and then returns templates
|
43
|
-
# with modified source
|
44
|
-
#
|
45
42
|
# @private
|
46
|
-
class EmptyTemplateResolver
|
47
|
-
|
43
|
+
class EmptyTemplateResolver
|
44
|
+
def self.build(path)
|
45
|
+
if path.is_a?(::ActionView::Resolver)
|
46
|
+
ResolverDecorator.new(path)
|
47
|
+
else
|
48
|
+
FileSystemResolver.new(path)
|
49
|
+
end
|
50
|
+
end
|
48
51
|
|
49
|
-
def
|
50
|
-
|
52
|
+
def self.nullify_template_rendering(templates)
|
53
|
+
templates.map do |template|
|
51
54
|
::ActionView::Template.new(
|
52
55
|
"",
|
53
56
|
template.identifier,
|
@@ -57,6 +60,44 @@ module RSpec
|
|
57
60
|
)
|
58
61
|
end
|
59
62
|
end
|
63
|
+
|
64
|
+
# Delegates all methods to the submitted resolver and for all methods
|
65
|
+
# that return a collection of `ActionView::Template` instances, return
|
66
|
+
# templates with modified source
|
67
|
+
#
|
68
|
+
# @private
|
69
|
+
class ResolverDecorator
|
70
|
+
def initialize(resolver)
|
71
|
+
@resolver = resolver
|
72
|
+
end
|
73
|
+
|
74
|
+
def method_missing(name, *args, &block)
|
75
|
+
result = @resolver.send(name, *args, &block)
|
76
|
+
nullify_templates(result)
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def nullify_templates(collection)
|
82
|
+
return collection unless collection.is_a?(Enumerable)
|
83
|
+
return collection unless collection.all? { |element| element.is_a?(::ActionView::Template) }
|
84
|
+
|
85
|
+
EmptyTemplateResolver.nullify_template_rendering(collection)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Delegates find_templates to the submitted path set and then returns
|
90
|
+
# templates with modified source
|
91
|
+
#
|
92
|
+
# @private
|
93
|
+
class FileSystemResolver < ::ActionView::FileSystemResolver
|
94
|
+
private
|
95
|
+
|
96
|
+
def find_templates(*args)
|
97
|
+
templates = super
|
98
|
+
EmptyTemplateResolver.nullify_template_rendering(templates)
|
99
|
+
end
|
100
|
+
end
|
60
101
|
end
|
61
102
|
|
62
103
|
# @private
|
@@ -71,23 +112,23 @@ module RSpec
|
|
71
112
|
# @private
|
72
113
|
module EmptyTemplates
|
73
114
|
def prepend_view_path(new_path)
|
74
|
-
lookup_context.view_paths.unshift(*_path_decorator(new_path))
|
115
|
+
lookup_context.view_paths.unshift(*_path_decorator(*new_path))
|
75
116
|
end
|
76
117
|
|
77
118
|
def append_view_path(new_path)
|
78
|
-
lookup_context.view_paths.push(*_path_decorator(new_path))
|
119
|
+
lookup_context.view_paths.push(*_path_decorator(*new_path))
|
79
120
|
end
|
80
121
|
|
81
122
|
private
|
82
123
|
|
83
|
-
def _path_decorator(
|
84
|
-
EmptyTemplateResolver.
|
124
|
+
def _path_decorator(*paths)
|
125
|
+
paths.map { |path| EmptyTemplateResolver.build(path) }
|
85
126
|
end
|
86
127
|
end
|
87
128
|
|
88
129
|
# @private
|
89
130
|
RESOLVER_CACHE = Hash.new do |hash, path|
|
90
|
-
hash[path] = EmptyTemplateResolver.
|
131
|
+
hash[path] = EmptyTemplateResolver.build(path)
|
91
132
|
end
|
92
133
|
|
93
134
|
included do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.0.
|
4
|
+
version: 3.5.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chelimsky
|
@@ -44,7 +44,7 @@ cert_chain:
|
|
44
44
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
45
45
|
F3MdtaDehhjC
|
46
46
|
-----END CERTIFICATE-----
|
47
|
-
date: 2016-
|
47
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: activesupport
|
@@ -94,56 +94,56 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 3.5.0.
|
97
|
+
version: 3.5.0.beta3
|
98
98
|
type: :runtime
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - '='
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 3.5.0.
|
104
|
+
version: 3.5.0.beta3
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: rspec-expectations
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - '='
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 3.5.0.
|
111
|
+
version: 3.5.0.beta3
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - '='
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 3.5.0.
|
118
|
+
version: 3.5.0.beta3
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: rspec-mocks
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - '='
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 3.5.0.
|
125
|
+
version: 3.5.0.beta3
|
126
126
|
type: :runtime
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - '='
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 3.5.0.
|
132
|
+
version: 3.5.0.beta3
|
133
133
|
- !ruby/object:Gem::Dependency
|
134
134
|
name: rspec-support
|
135
135
|
requirement: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
137
|
- - '='
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 3.5.0.
|
139
|
+
version: 3.5.0.beta3
|
140
140
|
type: :runtime
|
141
141
|
prerelease: false
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
144
|
- - '='
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 3.5.0.
|
146
|
+
version: 3.5.0.beta3
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
name: cucumber
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,14 +176,14 @@ dependencies:
|
|
176
176
|
name: ammeter
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
|
-
- -
|
179
|
+
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: 1.1.2
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
184
|
version_requirements: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- -
|
186
|
+
- - "~>"
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: 1.1.2
|
189
189
|
description: rspec-rails is a testing framework for Rails 3.x and 4.x.
|
@@ -269,7 +269,7 @@ files:
|
|
269
269
|
- lib/rspec/rails/view_path_builder.rb
|
270
270
|
- lib/rspec/rails/view_rendering.rb
|
271
271
|
- lib/rspec/rails/view_spec_methods.rb
|
272
|
-
homepage:
|
272
|
+
homepage: https://github.com/rspec/rspec-rails
|
273
273
|
licenses:
|
274
274
|
- MIT
|
275
275
|
metadata: {}
|
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
290
|
version: 1.3.1
|
291
291
|
requirements: []
|
292
292
|
rubyforge_project:
|
293
|
-
rubygems_version: 2.5.1
|
293
|
+
rubygems_version: 2.4.5.1
|
294
294
|
signing_key:
|
295
295
|
specification_version: 4
|
296
296
|
summary: RSpec for Rails
|
metadata.gz.sig
CHANGED
Binary file
|