thirteen-tien-len/spec/views/social_links/index.html.haml_spec.rb

24 lines
562 B
Ruby

require 'rails_helper'
RSpec.describe "social_links/index", type: :view do
before(:each) do
assign(:social_links, [
SocialLink.create!(
profile: nil,
url: "Url"
),
SocialLink.create!(
profile: nil,
url: "Url"
)
])
end
it "renders a list of social_links" do
render
cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td'
assert_select cell_selector, text: Regexp.new(nil.to_s), count: 2
assert_select cell_selector, text: Regexp.new("Url".to_s), count: 2
end
end