Sha256: 3d9a4e7914efabd3a0a9a5f9abb6adcd9b0bd8a2ddf9f0836bae1585bdaf9b1a

Contents?: true

Size: 593 Bytes

Versions: 28

Compression:

Stored size: 593 Bytes

Contents

require 'spec_helper'

describe Shoulda::Matchers::ActionController::FilterParamMatcher do
  context "given parameter filters" do
    before do
      Rails.application.config.filter_parameters = [:secret]
    end

    it "should accept filtering that parameter" do
      nil.should filter_param(:secret)
    end

    it "should reject filtering another parameter" do
      matcher = filter_param(:other)
      matcher.matches?(nil).should be_false
      matcher.failure_message.should include("Expected other to be filtered")
      matcher.failure_message.should =~ /secret/
    end
  end
end

Version data entries

28 entries across 20 versions & 4 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/shoulda-matchers-1.4.2/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.9.1.beta.3 vendor/bundle/gems/shoulda-matchers-1.4.2/spec/shoulda/action_controller/filter_param_matcher_spec.rb
devise_sociable-0.1.0 vendor/bundle/gems/shoulda-matchers-1.4.2/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.9.1.beta vendor/bundle/gems/shoulda-matchers-1.4.2/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.9.0 vendor/bundle/gems/shoulda-matchers-1.4.2/spec/shoulda/action_controller/filter_param_matcher_spec.rb
shoulda-matchers-1.4.2 spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/shoulda-matchers-1.4.1/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/shoulda-matchers-1.3.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/shoulda-matchers-1.2.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/shoulda-matchers-1.4.1/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/shoulda-matchers-1.2.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/shoulda-matchers-1.3.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.8.3 vendor/bundle/gems/shoulda-matchers-1.3.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.8.3 vendor/bundle/gems/shoulda-matchers-1.4.1/spec/shoulda/action_controller/filter_param_matcher_spec.rb
shoulda-matchers-1.4.1 spec/shoulda/action_controller/filter_param_matcher_spec.rb
shoulda-matchers-1.4.0 spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-0.8.1 vendor/bundle/gems/shoulda-matchers-1.3.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/shoulda-matchers-1.2.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/shoulda-matchers-1.2.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb
challah-rolls-0.1.0 vendor/bundle/gems/shoulda-matchers-1.3.0/spec/shoulda/action_controller/filter_param_matcher_spec.rb