Sha256: e235464540943a5487e6ea7f29cf2f686e095149f2aa65b672e7e03c7a852d55

Contents?: true

Size: 930 Bytes

Versions: 2

Compression:

Stored size: 930 Bytes

Contents

# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'attached_files/new', 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) }
  let(:attached_file) { FactoryBot.build(:attached_file, issue_comment: issue_comment) }
  before(:each) do
    assign(:attached_file, attached_file)
  end

  it 'renders new attached_file form' do
    render

    assert_select 'form[action=?][method=?]', attached_files_path, 'post' do
      assert_select 'input#attached_file_id[name=?]', 'attached_file[id]'
      assert_select 'select#attached_file_issue_comment_id[name=?]', 'attached_file[issue_comment_id]'
      assert_select 'input#attached_file_url[name=?]', 'attached_file[url]'
    end
  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/new.html.erb_spec.rb
model_base_generators-0.4.0 examples/rails-5.1/spec/views/attached_files/new.html.erb_spec.rb