This repository was archived by the owner on Oct 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 4242 end
4343 end
4444
45+ describe '#expected_status_code_after_store' do
46+ it 'returns 200 by default' do
47+ expect ( subject . expected_status_code_after_store ) . to eq 200
48+ end
49+ end
50+
4551 describe '#store_script_and_validate' do
46- it 'returns false if the response has a code !== 200 ' do
52+ it 'returns false if the response does not match the return value of #expected_status_code_after_store ' do
4753 typhoeus_res = Typhoeus ::Response . new
4854 allow ( typhoeus_res ) . to receive ( :code ) . and_return ( 404 )
55+ allow ( subject ) . to receive ( :expected_status_code_after_store ) . and_return ( 200 )
4956 allow ( subject ) . to receive ( :store_script ) . and_return ( Wpxf ::Net ::HttpResponse . new ( typhoeus_res ) )
5057 expect ( subject . store_script_and_validate ) . to be false
5158 end
5562 expect ( subject . store_script_and_validate ) . to be false
5663 end
5764
58- it 'returns true if the response code is 200 ' do
65+ it 'returns true if the response code matches the return value of #expected_status_code_after_store ' do
5966 typhoeus_res = Typhoeus ::Response . new
6067 allow ( typhoeus_res ) . to receive ( :code ) . and_return ( 200 )
68+ allow ( subject ) . to receive ( :expected_status_code_after_store ) . and_return ( 200 )
6169 allow ( subject ) . to receive ( :store_script ) . and_return ( Wpxf ::Net ::HttpResponse . new ( typhoeus_res ) )
6270 expect ( subject . store_script_and_validate ) . to be true
6371 end
You can’t perform that action at this time.
0 commit comments