Sha256: 7e05049a4a83f05bff3dcc91bf80d916718a8b981a85e089d81612e023a330c2

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe MergeController do
  include RSpec::Rails::ControllerExampleGroup
  
  it "should allow a combination of all rules following the options" do
    post :create, :a => 'hi', :b => 'ho', :h => {:b => 'hey', :c => 'fo'}
    response.code.should == "200"
  end
  
  it "should not allow combinations outside of the options" do
    begin
      post :update, :a => 'hi', :b => 'ho', :h => {:b => 'hey', :c => 'fo'}
      raise "should fail"
    rescue ParamAccessible::Error => e
      e.inaccessible_params.should == %w(a h[c])
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
param_accessible-0.0.2 spec/lib/merge_spec.rb
param_accessible-0.0.1 spec/lib/merge_spec.rb