aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/organisations/index.html.erb_spec.rb
blob: 2755a02154bf89c3b505b5afc090ba2a20ae5ac5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'rails_helper'

RSpec.describe "organisations/index", type: :view do
  before(:each) do
    assign(:organisations, [
      Organisation.create!(
        name: "Name"
      ),
      Organisation.create!(
        name: "Name"
      )
    ])
  end

  it "renders a list of organisations" do
    render
    cell_selector = Rails::VERSION::STRING >= '7' ? 'div>p' : 'tr>td'
    assert_select cell_selector, text: Regexp.new("Name".to_s), count: 2
  end
end