mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-07 13:38:12 -08:00
27 lines
754 B
Ruby
27 lines
754 B
Ruby
require "rails_helper"
|
|
require "nokogiri"
|
|
|
|
module Dashboard
|
|
include Engine.routes.url_helpers
|
|
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
|