Appending headers to Rspec controller tests

后端 未结 3 558
走了就别回头了
走了就别回头了 2021-02-05 15:35

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
  cont         


        
3条回答
  •  灰色年华
    2021-02-05 16:10

    I think you want (straight from one of your links)

    it "returns 200 ok"
      @request.headers['X-Indeed-Signature'] = signature
      post :indeed, parameters
      response.status.should == 200
    end
    

    You don't need subject(:response)

提交回复
热议问题