Sha256: d87f4c423b08ede05ce129e6207ad2bb16e81f3fb1890f0a94329d9b3e663298

Contents?: true

Size: 919 Bytes

Versions: 3

Compression:

Stored size: 919 Bytes

Contents

# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'attached_files/index', type: :view do
  let(:user) { FactoryGirl.create(:user) }
  let(:project) { FactoryGirl.create(:project, owner: user) }
  let(:issue) { FactoryGirl.create(:issue, project: project, creator: user) }
  let(:issue_comment) { FactoryGirl.create(:issue_comment, issue: issue, user: user) }
  before(:each) do
    assign(:attached_files, [
             FactoryGirl.create(:attached_file, issue_comment: issue_comment, url: 'attached_file_url_1'),
             FactoryGirl.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

3 entries across 3 versions & 1 rubygems

Version Path
model_base_generators-0.3.9 example/spec/views/attached_files/index.html.erb_spec.rb
model_base_generators-0.3.8 example/spec/views/attached_files/index.html.erb_spec.rb
model_base_generators-0.3.7 example/spec/views/attached_files/index.html.erb_spec.rb