rename_params 1.1.2 → 1.1.3

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
  SHA1:
3
- metadata.gz: acf76209a4669531b09b1d00e3eef3318ee303e5
4
- data.tar.gz: 4158052088d08ca8900531ddd8ab304fe2bf9ef7
3
+ metadata.gz: d4cb3e07380a5fe20a672c77c21d265591081003
4
+ data.tar.gz: c1d52eafde3e113008145ed81d74a86362761f3f
5
5
  SHA512:
6
- metadata.gz: 2c382593a6087364069e7df3a018f6d289e94ec5dd902e7d982c76178b2d4de12a695bd8df356b211648d6187708915657b784d8d71bc964cf47c3ba7a7719fd
7
- data.tar.gz: 681b875e1e9db9812c57b73079f1b686392c8566fdf77306c66d9e0da1446daa943d7e7d9837e579d882b5b4a568ba5d842019c1a630b8fae77911d78dc471f7
6
+ metadata.gz: a0d6589fc167e43b4d357251322734bca76e2bb0f90cbe6fc081f4187397ad7f623903fa38c29b39d9c4cf8ffcbb706a9a0e928b20d5bfb29b7c9afd18b575a8
7
+ data.tar.gz: 1262bff9b7728496dd68783472e501dc04bf6b04caf530233d3f1b68a6732f9fc6e5ffcb23fd3ded711c083886f00f2e5ba848401f226bba71cdcfac41d258c4
@@ -6,7 +6,7 @@ module RenameParams
6
6
  end
7
7
 
8
8
  def convert(value)
9
- @hash.with_indifferent_access[value]
9
+ @hash.with_indifferent_access[value] || value
10
10
  end
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module RenameParams
2
- VERSION = '1.1.2'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
@@ -5,6 +5,6 @@ describe RenameParams::Converters::HashConverter do
5
5
  describe '#convert' do
6
6
  it { expect(converter.convert(:a)).to eq 'A' }
7
7
  it { expect(converter.convert(:b)).to eq 'B' }
8
- it { expect(converter.convert(:c)).to be_nil }
8
+ it { expect(converter.convert(:c)).to be :c }
9
9
  end
10
10
  end
@@ -46,6 +46,13 @@ describe RenameParams::Macros::Rename, type: :controller do
46
46
  expect(controller.params).to eq default_params
47
47
  end
48
48
  end
49
+
50
+ context 'if param is not included in enum' do
51
+ it 'leaves params as they were' do
52
+ get :index, { admin: 'some_value' }
53
+ expect(controller.params).to eq default_params.merge('role' => 'some_value')
54
+ end
55
+ end
49
56
  end
50
57
 
51
58
  context 'and using a Proc converter' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rename_params
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Casiraghi