我想从每一行中删除主题,这使我的规范过于冗长,
我的模型有以下代码:-
描述“#clone_for_resubmit”做
let(:new_item) { @order_item1.clone_for_resubmit(:cart_group => @cart_group, :cloned_collections => { }, :order => @cart_group.order, :message => "this is just for testing purpose", :receiver => "example@example.com", :sender =>"ragarwal@kreeti.com" ) }
subject{ new_item}
it "should clone an order_item" do
gift = FactoryGirl.create(:gift, :order_item_id => @order_item1.id, :user => @user)
subject.cart_group.should == @cart_group
subject.collection.name.should == @order_item1.collection.name
subject.collection.book.title.should == @order_item1.collection.book.title
subject.collection.user.should == @order_item1.collection.user
subject.collection.book.book_chapters.count.should == @order_item1.collection.book.book_chapters.count
subject.collection.book.book_chapters.last.chapter_title.should == @order_item1.collection.book.book_chapters.last.chapter_title
subject.collection.items.last.user_recipe.recipe.name.should == @order_item1.collection.items.last.user_recipe.recipe.name
subject.collection.book.book_chapters.last.items.last.user_recipe.recipe.name.should == @order_item1.collection.book.book_chapters.last.items.last.user_recipe.recipe.name
subject.gift.recipient_email.should == gift.recipient_email
subject.gift.message.should == "this is just for testing purpose"
subject.gift.receiver.should == "example@example.com"
subject.gift.sender.should == "ragajhk@vy.com"
subject.payment.payment_amount.should == @order_item1.payment.payment_amount
subject.payment.order.should == @cart_group.order
end
结尾