我的控制器里有那个方法
def promotional_sales
redirect_to plans_path and return unless promotional_campaign_active?
config_meta_tags({}, {
title: "Subscription promotion in our website",
description: "Do you want to know more about our website promotions? Stay on top of all promotions and guarantee your discount"
})
if control_flag[:phase] == "captation"
setup_promotional_campaign
render :promotion_3
end
if control_flag[:phase] == "sales"
setup_courage_hotsite
render :hotsite_1
end
end
end我想写一个RSpec测试,涵盖在促销活动不活跃时是否发生了对plans_path的重定向,如果是活动的话,则返回到下一个块。
拜托,你能指导我怎么写这个测试吗?
发布于 2022-05-20 07:04:14
https://stackoverflow.com/questions/72311931
复制相似问题