【发布时间】:2012-10-29 20:58:31
【问题描述】:
我正在测试以确保将创建的用户分配给我的实例变量@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)
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 testing rspec factory-bot