regressor 0.4.0 → 0.4.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: 8d64cf73d04c20acd51f9b2f556402f4db8bc5e7
4
- data.tar.gz: a374e36cf41028092a97cdd2b80af909b4db39e2
3
+ metadata.gz: a26f0b24d23a0675677e10e674bdd1f5f9d45ba1
4
+ data.tar.gz: d33e20d7d14a6de3b1bfd9d91d141c3ab8352d66
5
5
  SHA512:
6
- metadata.gz: 4a468ed532fc84c26dcde872e0685b4ccfda97d2b95d3557a1889d27d67f302c10804d2da88f1714ef060c08c1f97f77e5df79f26ddeadcdc5b0a8f127c73f76
7
- data.tar.gz: d7df289bfc83b549cdde66e98bab21c6a36c4bd26d410f4d556a0a9f4d53c8de3d4a3daf058fe74aeda25c440a09997d491fa112d0047511071eeaadfd9cfcc3
6
+ metadata.gz: d624d33ce8c31ced528dbf21f1375421c773401fef614e74cd7d3919c8880e7bc96829181e8bbc2882558f5eff9c76afe2d9832627b391794129856dce47fbe3
7
+ data.tar.gz: dd6a8615fe4efb6451d50e53f6c7cf8853c330fc7e5ebf0dc96f8044484c1a6ed1dd3c794556cbec4997aee84f10149df78b461a9e0c648d03eaed17ca76da01
@@ -24,23 +24,29 @@ module Regressor
24
24
  def generate_example(journey_route, controller_path, action_method, required_parts, url)
25
25
  request_method = journey_route.constraints[:request_method]
26
26
  if request_method.match('GET')
27
- "it { should route(:get, '#{url}').to(#{{controller: controller_path, action: action_method}.merge(required_parts).to_s}) } "
27
+ "it { should route(:get, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) }"
28
28
  elsif request_method.match('POST')
29
- "it { should route(:post, '#{url}').to(#{{controller: controller_path, action: action_method}.merge(required_parts).to_s}) } "
29
+ "it { should route(:post, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
30
30
  elsif request_method.match('PUT')
31
- "it { should route(:put, '#{url}').to(#{{controller: controller_path, action: action_method}.merge(required_parts).to_s}) } "
31
+ "it { should route(:put, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
32
32
  elsif request_method.match('PATCH')
33
- "it { should route(:patch, '#{url}').to(#{{controller: controller_path, action: action_method}.merge(required_parts).to_s}) } "
33
+ "it { should route(:patch, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
34
34
  elsif request_method.match('DELETE')
35
- "it { should route(:delete, '#{url}').to(#{{controller: controller_path, action: action_method}.merge(required_parts).to_s}) } "
35
+ "it { should route(:delete, '#{url}').to('#{controller_path}##{action_method}', #{required_parts}) } "
36
36
  end
37
37
  end
38
38
 
39
39
  def extract_required_parts(journey_route)
40
40
  journey_route.required_parts.inject({}) do |required_part_hash, required_part|
41
41
  required_part_hash.merge!({
42
- required_part => 1
42
+ required_part => '1'
43
43
  })
44
+ if journey_route.defaults[:format]
45
+ required_part_hash.reverse_merge!({
46
+ format: journey_route.defaults[:format]
47
+ })
48
+ end
49
+ required_part_hash
44
50
  end
45
51
  end
46
52
 
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- describe <%= @controller.controller %> do
3
+ RSpec.describe <%= @controller.controller %>, regressor: true do
4
4
  # === Routes (REST) ===
5
5
  <%= @controller.rest_routes %>
6
6
  # === Callbacks (Before) ===
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- RSpec.describe <%= @model.model %> do
3
+ RSpec.describe <%= @model.model %>, regressor: true do
4
4
 
5
5
  # === Relations ===
6
6
  <%= @model.belong_to_relations %>
@@ -1,3 +1,3 @@
1
1
  module Regressor
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regressor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erwin Schens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda-matchers
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.7'
19
+ version: 2.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.7'
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: faker
29
29
  requirement: !ruby/object:Gem::Requirement