0

This page has a controller spec example that looks like this:

require "spec_helper"

describe WidgetsController do
  describe "GET index" do
    it "has a 200 status code" do
      get :index
      expect(response.code).to eq("200")
    end
  end
end

Where would I find the source code for the get function? I don't even know if that's part of RSpec or Rails.

1 Answer 1

3

The code can be found here. Turns out it's part of Rails, not RSpec.

https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/test_case.rb#L474

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.