rao-view_helper 0.0.40.pre → 0.0.45.pre

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
2
  SHA256:
3
- metadata.gz: 496e8f5beb847749d1412ecfefa0b4e57401e158b5dd12c230cd1b112591e3e8
4
- data.tar.gz: db40094919e20543cfc79e418c6052424200cf30c407f74ad53ed0304c1b3680
3
+ metadata.gz: 1c2ae8b666a9e63c52aae998de58aa2373e2466e01b9f31788f5b73db2213b96
4
+ data.tar.gz: b8712d10bb8c15c033f3db7303e40bf383ccfd8a177fe42f382b6bd5f158de8f
5
5
  SHA512:
6
- metadata.gz: a62fc4b223c9f456b3f1c44ea9daf6c823c27dd447bca992b3526fcded91ced85b98ed768047eeb6fc264fe5a0761e44ba3c176526436954d28606a7a893435d
7
- data.tar.gz: c676d32f6e4f59377737003c9923abef0e5ade59e22172f3c48cf5e4075e5ad2a43a2de3cb069d41e0f0b084d878f0c00e452f4b269cb76e7e07496917a85bbf
6
+ metadata.gz: 376726c2f17e8733574c5a09124352dc4cfc155edf7de9f61a21d8d729e9168bdc2c11fdf8c83eb34ccd6faee74052baa611e8b37a1dc75471774f65b94ab0d3
7
+ data.tar.gz: 8803b3e26558eb8534a073ffe7cbafc125d5476d62a07c02dd0958f78a4c7821c2c6a4d877ec0743afa7b0eab90586cf503a7b777c42fc99e87b3f427618f690
@@ -30,14 +30,13 @@ module Rao
30
30
  #
31
31
  # # if you need to set things like a request on your context you can
32
32
  # # do it as follows:
33
- # let(:request) { ActionDispatch::Request.new({ "SCRIPT_NAME" => "", "PATH_INFO" => "/de" }) }
34
- #
35
- # before(:each) do
36
- # view.request = request
37
- # end
33
+ # let(:request) { ActionDispatch::Request.new({ 'rack.input' => StringIO.new, "SCRIPT_NAME" => "", "PATH_INFO" => "/de" }) }
38
34
  #
39
35
  # # this is useful when your view helper makes call like c.request.path
40
36
  #
37
+ # # You can add get params to the request:
38
+ # let(:request) { ActionDispatch::Request.new({ 'rack.input' => StringIO.new, 'QUERY_STRING' => "foo=bar" }) }
39
+ #
41
40
  # # if you need to change the default_url_options you may do so like this
42
41
  # let(:default_url_options) { { host: 'example.org' } }
43
42
  #
@@ -72,7 +71,9 @@ module Rao
72
71
  def self.included(mod)
73
72
  mod.let(:view_paths) { ActionController::Base.view_paths }
74
73
  mod.let(:assigns) { {} }
75
- mod.let(:view) { ActionView::Base.new(view_paths, assigns) }
74
+ mod.let(:request) { ActionDispatch::Request.new({ 'rack.input' => StringIO.new }) }
75
+ mod.let(:controller) { ActionController::Base.new.tap { |c| c.request = request; c } }
76
+ mod.let(:view) { ActionView::Base.new(view_paths, assigns, controller) }
76
77
  mod.let(:view_helper) { described_class.new(view) }
77
78
  mod.let(:method_name) { |e| e.metadata[:example_group][:description].to_sym }
78
79
  mod.let(:default_url_options) { { host: 'localhost:3000' } }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rao-view_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.40.pre
4
+ version: 0.0.45.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-17 00:00:00.000000000 Z
11
+ date: 2020-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: 1.3.1
148
148
  requirements: []
149
- rubygems_version: 3.1.2
149
+ rubygems_version: 3.1.4
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: View Helper Objects for Ruby on Rails.