轨道上的红宝石 - Rspec 路由测试未通过



下面的 rspec 测试没有通过,我不确定我做错了什么。它在浏览器中路由正常,但测试未通过。

require 'spec_helper'
describe QueueVideosController do
  describe "GET show" do
    context "with authenticated users" do
      it "routes /queue to the QueueVideos controller" do
        expect(get("/queue")).to route_to("queue_videos#show")
      end
    end
  end
end

从我的控制器:

class QueueVideosController < ApplicationController
 def show
 end
end

从我的路由文件:

 get '/queue' => 'queue_videos#show'

尝试使用不同的语法:

expect(get: "/queue").to route_to(
  controller: "queue_videos",
  action: "show"
)

最新更新