use json as default response format
This commit is contained in:
@@ -3,16 +3,16 @@ require "rails_helper"
|
||||
RSpec.describe PostsController, type: :routing do
|
||||
describe "routing" do
|
||||
it "routes to #index" do
|
||||
expect(get: "/posts").to route_to("posts#index")
|
||||
expect(get: "/posts").to route_to("posts#index", format: :json)
|
||||
end
|
||||
|
||||
it "routes to #show" do
|
||||
expect(get: "/posts/1").to route_to("posts#show", id: "1")
|
||||
expect(get: "/posts/1").to route_to("posts#show", id: "1", format: :json)
|
||||
end
|
||||
|
||||
|
||||
it "routes to #create" do
|
||||
expect(post: "/posts").to route_to("posts#create")
|
||||
expect(post: "/posts").to route_to("posts#create", format: :json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user