import_spec.rb 583 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Import do
  4. let(:account) { Fabricate(:account) }
  5. let(:type) { 'following' }
  6. let(:data) { attachment_fixture('imports.txt') }
  7. describe 'validations' do
  8. it 'is invalid without an type' do
  9. import = described_class.create(account: account, data: data)
  10. expect(import).to model_have_error_on_field(:type)
  11. end
  12. it 'is invalid without a data' do
  13. import = described_class.create(account: account, type: type)
  14. expect(import).to model_have_error_on_field(:data)
  15. end
  16. end
  17. end