Guest User

Untitled

a guest
Mar 16th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.76 KB | None | 0 0
  1. describe '#strip_invisible_chars' do
  2.     let(:some) { {two: "three"} }
  3.  
  4.     subject { controller.send :strip_invisible_chars }
  5.    
  6.     #before { allow(Util::Strings).to receive(:strip_control_chars).with(:params).and_return(:some) }
  7.  
  8.     context 'yes' do
  9.       let(:params) { {one: "two"} }
  10.      
  11.       before { allow(Util::Strings).to receive(:strip_control_chars).with(:params).and_return(true) }
  12.  
  13.       it 'returns result' do  
  14.         byebug
  15.         expect(response.status).to eq 200
  16.       end
  17.     end
  18.  
  19.     context 'no' do
  20.       let(:params) {}
  21.  
  22.       before { allow(Util::Strings).to receive(:strip_control_chars).with(:params).and_return(false) }
  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