Guest User

Untitled

a guest
Mar 16th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.63 KB | None | 0 0
  1. def strip_invisible_chars
  2.     Util::Strings.strip_control_chars(params)
  3.   end
  4.  
  5. describe '#strip_invisible_chars' do
  6.     let(:some) { {two: "three"} }
  7.  
  8.     subject { controller.send :strip_invisible_chars }
  9.    
  10.     before { allow(Util::Strings).to receive(:strip_control_chars).with(:params).and_return(:some) }
  11.  
  12.     context 'yes' do
  13.       let(:params) { {one: "two"} }
  14.      
  15.       it 'returns result' do
  16.         byebug
  17.         expect(response.status).to eq 200
  18.       end
  19.     end
  20.  
  21.     context 'no' do
  22.       let(:params) {}
  23.  
  24.       it 'returns result' do
  25.         expect(response.status).to eq 400
  26.       end
  27.     end
  28.   end
Advertisement
Add Comment
Please, Sign In to add comment