我在我的has_and_belongs_to_many模型中创建一个新的关系时遇到了一些麻烦。我这样定义的车型: journals model
has_and_belongs_to_many :posts
post model
has_and_belongs_to_many :journal
我不知道如何创建的关联,我做了一个按钮,但我不知道它是如何工作的。我创建的
我试图设置规范以正确运行我的嵌套资源。 这是测试代码,我想正确设置 it "redirects to the created unit" do
post :create, {:course_id => @course.id , :unit => valid_attributes}
response.should redirect_to(course_unit_path(@cou
我有一个简单的用户工厂,看起来像这样: FactoryGirl.define do
factory :user do
name "jeff"
email "[email protected]"
password "foobar"
password_confirmation "foobar"
end
end
,我试图测试内置authe