うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

Rspec

In Rspec routing test code, add format to target url.

Memo require "rails_helper" RSpec.describe Api::V2::HogeController, type: :routing do describe "routing" do it "routes to #mine" do expect(:get => "/api/v2/hoges/mine").to route_to("api/v2/bookmarks#mine", format: "json") end . . .