Sha256: 21642782af4ad5131874662391631278575fb3f1a743d1bf0c013dbf7d74cb90

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

describe Riak do
  require 'riak/core_ext/to_param'

  it "converts params correctly" do
    expect({ :name => 'David', :nationality => 'Danish' }.to_param).to eq("name=David&nationality=Danish")
  end

  # Based on the activesupport implementation.
  # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/to_param.rb
  it "converts namespaced params correctly" do
    expect({ :name => 'David', :nationality => 'Danish' }.to_param('user')).to eq("user%5Bname%5D=David&user%5Bnationality%5D=Danish")
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
riak-client-2.4.1 spec/riak/core_ext/to_param_spec.rb
riak-client-2.4.0 spec/riak/core_ext/to_param_spec.rb
riak-client-2.4.0.pre1 spec/riak/core_ext/to_param_spec.rb
riak-client-2.3.2 spec/riak/core_ext/to_param_spec.rb
riak-client-2.3.1 spec/riak/core_ext/to_param_spec.rb