test

Ruby code posted by test
created at 06 Aug 05:59

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
describe 'permit some elements from params and miss others' do
  before do
    @params = ActionController::Parameters.new @hash
  end
  it 'should log non-permitted attributes' do
    ActiveSupport::Notifications.
      expects(:instrument).
      with('unpermitted_parameters.action_controller', keys: ['body']).
      once
    @params.permit(:title).must_equal 'title' => 'Test'
  end
end
401 Bytes in 2 ms with coderay