Tag:

请求规范中的存根authentication

在编写请求规范时,如何设置会话和/或存根控制器方法? 我试图在我的集成testing – RSpec /请求存根validation 这是一个testing的例子 require File.dirname(__FILE__) + '/../spec_helper' require File.dirname(__FILE__) + '/authentication_helpers' describe "Messages" do include AuthenticationHelpers describe "GET admin/messages" do before(:each) do @current_user = Factory :super_admin login(@current_user) end it "displays received messages" do sender = Factory :jonas direct_message = Message.new(:sender_id => sender.id, :subject => "Message system.", :content => "content", :receiver_ids => [@current_user.id]) […]