require 'rails_helper'

RSpec.describe "supotasks/index", type: :view do
  before(:each) do
    assign(:supotasks, [
      Supotask.create!(
        :mail_account => nil,
        :cron => "Cron",
        :description => "Description",
        :script => "Script"
      ),
      Supotask.create!(
        :mail_account => nil,
        :cron => "Cron",
        :description => "Description",
        :script => "Script"
      )
    ])
  end

  it "renders a list of supotasks" do
    render
    assert_select "tr>td", :text => nil.to_s, :count => 2
    assert_select "tr>td", :text => "Cron".to_s, :count => 2
    assert_select "tr>td", :text => "Description".to_s, :count => 2
    assert_select "tr>td", :text => "Script".to_s, :count => 2
  end
end
