Sha256: 13504b8a56cd82aee4e41dcac7132b393bb8241f6cf76e551aff46b8026844fd

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'attached_files/index', type: :view do
  let(:user) { FactoryBot.create(:user) }
  let(:project) { FactoryBot.create(:project, owner: user) }
  let(:issue) { FactoryBot.create(:issue, project: project, creator: user) }
  let(:issue_comment) { FactoryBot.create(:issue_comment, issue: issue, user: user) }
  before(:each) do
    assign(:attached_files, [
             FactoryBot.create(:attached_file, issue_comment: issue_comment, url: 'attached_file_url_1'),
             FactoryBot.create(:attached_file, issue_comment: issue_comment, url: 'attached_file_url_2'),
           ])
  end

  it 'renders a list of attached_files' do
    render
    assert_select 'tr>td', text: issue_comment.title, count: 2
    assert_select 'tr>td', text: 'attached_file_url_1', count: 1
    assert_select 'tr>td', text: 'attached_file_url_2', count: 1
  end
end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
model_base_generators-0.4.0 examples/rails-5.0/spec/views/attached_files/index.html.erb_spec.rb
model_base_generators-0.4.0 examples/rails-5.1/spec/views/attached_files/index.html.erb_spec.rb