rename_params 1.1.1 → 1.1.2
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
- data/lib/rename_params/params.rb +1 -1
- data/lib/rename_params/version.rb +1 -1
- data/spec/macros/rename_spec.rb +12 -3
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: acf76209a4669531b09b1d00e3eef3318ee303e5
         | 
| 4 | 
            +
              data.tar.gz: 4158052088d08ca8900531ddd8ab304fe2bf9ef7
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2c382593a6087364069e7df3a018f6d289e94ec5dd902e7d982c76178b2d4de12a695bd8df356b211648d6187708915657b784d8d71bc964cf47c3ba7a7719fd
         | 
| 7 | 
            +
              data.tar.gz: 681b875e1e9db9812c57b73079f1b686392c8566fdf77306c66d9e0da1446daa943d7e7d9837e579d882b5b4a568ba5d842019c1a630b8fae77911d78dc471f7
         | 
    
        data/lib/rename_params/params.rb
    CHANGED
    
    
    
        data/spec/macros/rename_spec.rb
    CHANGED
    
    | @@ -285,9 +285,18 @@ describe RenameParams::Macros::Rename, type: :controller do | |
| 285 285 | 
             
                  describe 'move_to' do
         | 
| 286 286 | 
             
                    before { routes.draw { get 'update' => 'anonymous#update' } }
         | 
| 287 287 |  | 
| 288 | 
            -
                     | 
| 289 | 
            -
                       | 
| 290 | 
            -
             | 
| 288 | 
            +
                    context 'when sending params' do
         | 
| 289 | 
            +
                      it 'renames billing_contact[:name] to contact[:name]' do
         | 
| 290 | 
            +
                        put :update, { 'billing_contact' => { 'name' => 'Marcelo' } }
         | 
| 291 | 
            +
                        expect(controller.params).to eq('controller' => 'anonymous', 'action' => 'update', 'billing_contact' => {}, 'contact' => { 'name' =>'Marcelo' })
         | 
| 292 | 
            +
                      end
         | 
| 293 | 
            +
                    end
         | 
| 294 | 
            +
             | 
| 295 | 
            +
                    context 'when not sending params' do
         | 
| 296 | 
            +
                      it 'leaves params as they were' do
         | 
| 297 | 
            +
                        put :update
         | 
| 298 | 
            +
                        expect(controller.params).to eq('controller' => 'anonymous', 'action' => 'update')
         | 
| 299 | 
            +
                      end
         | 
| 291 300 | 
             
                    end
         | 
| 292 301 | 
             
                  end
         | 
| 293 302 | 
             
                end
         |