【发布时间】:2016-06-06 03:59:33
【问题描述】:
我在哪里可以找到有关如何编写使用 ajaxful_rating gem 的 Rails rspec 测试的指南。我正在编写的测试类似于下面的测试。 https://github.com/edgarjs/ajaxful-rating
require "rails_helper"
RSpec.feature "Users can create new review" do
scenario "with valid attributes" do
# Put in a 5 star rating here.
fill_in "Review", with: "This place is pretty good."
click_button "Create Review"
expect(page).to have_content "Review has been created."
end
end
【问题讨论】:
-
要选择 5 开始评级,您需要单击第 5 次开始的元素 - 不幸的是,从 ajaxful 评级页面链接到的演示应用程序已关闭,所以我看不到 html 的内容它生成的是——如果你将它在页面上生成的 html 添加到你的问题中,我们可以告诉你如何点击它
标签: ruby-on-rails capybara rspec-rails