我正在测试以确保将创建的用户分配给我的实例变量@user
。我明白 get 是什么意思,但我不确定要为测试写什么。我返回错误 URI 或 URL 的参数错误。我的测试出了什么问题,我该如何解决?
it "checks @user variable assignment for creation" do
p = FactoryGirl.create(:user)
get :users
# I'm confused on what this line above means/does. What does the hash :users refer
#to
assigns[:user].should == [p]
end
expected URI object or string error
引用和get :users
错误如下
Failure/Error get :users
ArgumentError:
bad argument: (expected URI object or URI string)