Sha256: 9f08fc70231c06be7659455a4a8df52f626c53060133d20bfd5635e99ed17647

Contents?: true

Size: 763 Bytes

Versions: 33

Compression:

Stored size: 763 Bytes

Contents

require 'rails_helper'

describe Tabulatr::ParamsBuilder do
  it 'accepts an argument which is in the ALLOWED_PARAMS array' do
    pb = nil
    expect{pb = Tabulatr::ParamsBuilder.new(filter: false)}.to_not raise_error
    expect(pb.filter).to be_falsey
  end

  it 'does not accept a param which is not in the ALLOWED_PARAMS array' do
    stub_const('Tabulatr::ParamsBuilder::ALLOWED_PARAMS', [:allowed_params])
    expect{Tabulatr::ParamsBuilder.new(non_allowed_param: 'test')}.to raise_error(ArgumentError)
  end

  it 'does not accept a param which is in the DEPRECATED_PARAMS array' do
    stub_const('Tabulatr::ParamsBuilder::DEPRECATED_PARAMS', [:deprecated_param])
    expect{Tabulatr::ParamsBuilder.new(deprecated_param: 'test')}.to raise_error
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
tabulatr2-0.10.4 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.10.3 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.10.2 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.10.1 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.10.0 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.48 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.47 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.46 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.45 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.44 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.43 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.42 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.41 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.40 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.39 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.38 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.37 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.36 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.35 spec/lib/tabulatr/params_builder_spec.rb
tabulatr2-0.9.34 spec/lib/tabulatr/params_builder_spec.rb