Sha256: 7b39876677a9bc67c119a4b030455a1e4cc4474f93ef782e26c0fd88fee445c6

Contents?: true

Size: 469 Bytes

Versions: 10

Compression:

Stored size: 469 Bytes

Contents

require 'spec_helper'

describe SchemaTools::Cleaner do

  context 'params cleaning' do
    let(:params){
      { id: 'some id',
        last_name: 'Clean',
        first_name: 'Paul'
      }
    }

    after :each do
      SchemaTools::Reader.registry_reset
    end

    it 'should remove invalid keys from hash' do
      SchemaTools::Cleaner.clean_params!(:client, params)
      params[:last_name].should == 'Clean'
      params[:id].should be_nil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
json_schema_tools-0.1.2 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.1.1 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.1.0 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.8 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.7 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.6 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.5 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.4 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.3 spec/schema_tools/cleaner_spec.rb
json_schema_tools-0.0.2 spec/schema_tools/cleaner_spec.rb