Sha256: f5c58e8456ce9b3600d5628f84ad152b5f8f7508cfe88bc048e0e251df99eea6

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

# frozen_string_literal: true
require 'rails_helper'

RSpec.describe 'attached_files/new', 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) }
  let(:attached_file) { FactoryGirl.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

3 entries across 3 versions & 1 rubygems

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