aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/operations/index.html.erb_spec.rb
blob: 5fa64fe78496d733d092c3164946e2f567ac72f2 (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 "operations/index", type: :view do
  before(:each) do
    assign(:operations, [
      Operation.create!(
        name: "Name"
      ),
      Operation.create!(
        name: "Name"
      )
    ])
  end

  it "renders a list of operations" 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