Appending headers to Rspec controller tests
问题 I'm trying to write out tests for a controller of mine that takes in requests from external services. So far this is my test: describe ApplyController do context 'when valid' do let(:parameters) do file = File.join File.dirname(__FILE__), '..', 'samples', 'Indeed.json' JSON.parse(File.read file) end let(:signature) { 'GC02UVj0d4bqa5peNFHdPQAZ2BI=' } subject(:response) { post :indeed, parameters, 'X-Indeed-Signature' => signature } it 'returns 200 ok if Request is valid' do expect(response