You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
718 B

require "rails_helper"
require "nokogiri"
module Dashboard
RSpec.describe "/dashboard/examples/index", type: :view do
before(:each) do
assign(:examples, [
Example.create!(
text: "Word",
body: "Sentence"
),
Example.create!(
text: "Word",
body: "Sentence"
)
])
end
it "renders a list of examples" do
render
cell_selector = Rails::VERSION::STRING >= "7" ? "div>p" : "tr>td"
assert_select cell_selector, text: Regexp.new("Word".to_s), count: 2
assert_select cell_selector, text: Regexp.new("Sentence".to_s), count: 2
end
end
end