zizia 5.2.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +17 -3
  3. data/.github_changelog_generator +1 -1
  4. data/CHANGELOG.md +194 -17
  5. data/README.md +39 -21
  6. data/app/assets/stylesheets/zizia/_button.scss +10 -0
  7. data/app/assets/stylesheets/zizia/zizia.scss +1 -5
  8. data/app/controllers/zizia/csv_import_details_controller.rb +3 -3
  9. data/app/helpers/zizia/application_helper.rb +6 -0
  10. data/app/importers/modular_importer.rb +10 -6
  11. data/app/lib/zizia/metadata_details.rb +14 -14
  12. data/app/uploaders/zizia/csv_manifest_validator.rb +2 -2
  13. data/app/views/zizia/csv_import_details/_pre_ingest_files_table.html.erb +31 -22
  14. data/app/views/zizia/csv_import_details/show.html.erb +5 -1
  15. data/app/views/zizia/csv_imports/_record_count.html.erb +1 -1
  16. data/config/initializers/content_deposit_event_job_prepends.rb +10 -0
  17. data/config/initializers/file_set_attached_event_job_prepends.rb +12 -0
  18. data/config/initializers/prepends.rb +2 -0
  19. data/db/migrate/20191114021032_add_status_to_pre_ingest_file.rb +5 -0
  20. data/db/migrate/20191210223833_add_status_to_pre_ingest_work.rb +5 -0
  21. data/lib/zizia/hyrax/hyrax_basic_metadata_mapper.rb +10 -1
  22. data/lib/zizia/parser.rb +6 -6
  23. data/lib/zizia/version.rb +1 -1
  24. data/spec/dummy/.gitignore +1 -1
  25. data/spec/dummy/app/models/work.rb +1 -1
  26. data/spec/dummy/db/schema.rb +2 -0
  27. data/spec/dummy/db/test.sqlite3 +0 -0
  28. data/spec/dummy/spec/fixtures/csv_import/csv_files_with_problems/extra - headers.csv +4 -4
  29. data/spec/dummy/spec/fixtures/csv_import/good/all_fields.csv +2 -2
  30. data/spec/dummy/spec/fixtures/csv_import/good/all_fields_multi.csv +2 -0
  31. data/spec/dummy/spec/support/capybara.rb +1 -0
  32. data/spec/dummy/spec/system/csv_import_details_page_spec.rb +29 -4
  33. data/spec/dummy/spec/system/import_csv_with_warnings_spec.rb +1 -1
  34. data/spec/dummy/spec/system/import_file_status_spec.rb +95 -0
  35. data/spec/dummy/spec/system/import_from_csv_spec.rb +8 -9
  36. data/spec/factories/pre_ingest_work.rb +0 -1
  37. data/spec/models/zizia/application_job_spec.rb +12 -0
  38. data/spec/support/hyrax/basic_metadata.rb +3 -0
  39. data/spec/zizia/csv_format_validator_spec.rb +1 -1
  40. data/spec/zizia/hyrax/hyrax_basic_metadata_mapper_spec.rb +5 -1
  41. data/zizia.gemspec +12 -10
  42. metadata +84 -35
  43. data/.travis.yml +0 -12
@@ -2,24 +2,24 @@
2
2
  module Zizia
3
3
  class CsvImportDetailsController < ApplicationController
4
4
  helper_method :sort_column, :sort_direction, :user
5
-
6
5
  load_and_authorize_resource
7
6
  with_themed_layout 'dashboard'
8
7
 
9
8
  def index
10
9
  @csv_import_details = if csv_import_detail_params[:user] && user_id
11
10
  Zizia::CsvImportDetail
12
- .order(sort_column + ' ' + sort_direction)
11
+ .order("#{sort_column} #{sort_direction}, id DESC")
13
12
  .where(depositor_id: user_id).page csv_import_detail_params[:page]
14
13
  else
15
14
  Zizia::CsvImportDetail
16
- .order(sort_column + ' ' + sort_direction).page csv_import_detail_params[:page]
15
+ .order("#{sort_column} #{sort_direction}, id DESC").page csv_import_detail_params[:page]
17
16
  end
18
17
  end
19
18
 
20
19
  def show
21
20
  @csv_import_detail = Zizia::CsvImportDetail
22
21
  .find(csv_import_detail_params[:id])
22
+ @pre_ingest_works = Kaminari.paginate_array(@csv_import_detail.pre_ingest_works, total_count: @csv_import_detail.pre_ingest_works.count).page(csv_import_detail_params[:page]).per(10)
23
23
  end
24
24
 
25
25
  private
@@ -30,5 +30,11 @@ module Zizia
30
30
  def collections?
31
31
  !ActiveFedora::SolrService.query('has_model_ssim:Collection').empty?
32
32
  end
33
+
34
+ def status_icon(status)
35
+ # rubocop:disable Rails/OutputSafety
36
+ return "<span class='glyphicon glyphicon-ok-sign text-success' aria-label='Status: Complete'></span>".html_safe if status == 'attached'
37
+ "<span class='glyphicon glyphicon-question-sign' aria-label='Status: Unknown'></span>".html_safe
38
+ end
33
39
  end
34
40
  end
@@ -39,12 +39,16 @@ class ModularImporter
39
39
  pre_ingest_work = Zizia::PreIngestWork.find_or_create_by(deduplication_key: record.mapper.metadata['deduplication_key'])
40
40
  pre_ingest_work.csv_import_detail_id = csv_import_detail.id
41
41
  record.mapper.files.each do |child_file|
42
- full_path = Dir.glob("#{ENV['IMPORT_PATH']}/**/#{child_file}").first
43
- pre_ingest_file = Zizia::PreIngestFile.new(row_number: index + 1,
44
- pre_ingest_work: pre_ingest_work,
45
- filename: child_file,
46
- size: File.size(full_path))
47
- pre_ingest_file.save
42
+ begin
43
+ full_path = Dir.glob("#{ENV['IMPORT_PATH']}/**/#{child_file}").first
44
+ pre_ingest_file = Zizia::PreIngestFile.new(row_number: index + 1,
45
+ pre_ingest_work: pre_ingest_work,
46
+ filename: child_file,
47
+ size: File.size(full_path))
48
+ pre_ingest_file.save
49
+ rescue
50
+ Rails.logger.error "Error: Could not create Zizia::PreIngestFile for #{child_file}"
51
+ end
48
52
  end
49
53
  pre_ingest_work.save
50
54
  end
@@ -71,28 +71,28 @@ module Zizia
71
71
 
72
72
  def file_definition
73
73
  {
74
- attribute: 'files',
75
- predicate: 'n/a',
76
- multiple: 'true',
77
- type: 'String',
78
- validator: 'Required, must name a file on the server',
79
- label: 'Items (listed at bottom of page)',
74
+ attribute: 'files',
75
+ predicate: 'n/a',
76
+ multiple: 'true',
77
+ type: 'String',
78
+ validator: 'Required, must name a file on the server',
79
+ label: 'Items (listed at bottom of page)',
80
80
  csv_header: 'files',
81
- required_on_form: 'true',
81
+ required_on_form: 'true',
82
82
  usage: MetadataUsage.instance.usage['files']
83
83
  }
84
84
  end
85
85
 
86
86
  def visibility_definition
87
87
  {
88
- attribute: 'visibility',
89
- predicate: 'n/a',
90
- multiple: 'false',
91
- type: 'String',
92
- validator: 'Required, must exist in the application\'s controlled vocabulary for visiblity levels.',
93
- label: 'Visibility',
88
+ attribute: 'visibility',
89
+ predicate: 'n/a',
90
+ multiple: 'false',
91
+ type: 'String',
92
+ validator: 'Required, must exist in the application\'s controlled vocabulary for visiblity levels.',
93
+ label: 'Visibility',
94
94
  csv_header: 'visibility',
95
- required_on_form: 'true',
95
+ required_on_form: 'true',
96
96
  usage: MetadataUsage.instance.usage['visibility']
97
97
  }
98
98
  end
@@ -63,7 +63,7 @@ module Zizia
63
63
  'publisher', 'date created', 'subject',
64
64
  'language', 'identifier', 'location',
65
65
  'related url', 'bibliographic_citation',
66
- 'source', 'visibility']
66
+ 'source', 'visibility', 'deduplication_key', 'type']
67
67
  end
68
68
 
69
69
  def parse_csv
@@ -82,7 +82,7 @@ module Zizia
82
82
  end
83
83
 
84
84
  def required_headers
85
- ['title', 'creator', 'keyword', 'rights statement', 'visibility', 'files']
85
+ ['title', 'creator', 'keyword', 'rights statement', 'visibility', 'files', 'deduplication_key']
86
86
  end
87
87
 
88
88
  def duplicate_headers
@@ -1,24 +1,33 @@
1
- <table id="files-table" class="dataTable display responsive nowrap table table-striped works-list" style="width:100%">
2
- <tr>
3
- <th>Filename</th>
4
- <th>Size</th>
5
- <th>Row Number</th>
6
- <th>Date Created</th>
7
- </tr>
8
- <% pre_ingest_work.pre_ingest_files.each do |pre_ingest_file| %>
1
+ <div class="pre-ingest-file-table">
2
+ <a class="btn btn-primary" data-toggle="collapse" href="#files-table-<%= pre_ingest_work.id %>" role="button" aria-expanded="false" aria-controls="files-table-<%= pre_ingest_work.id %>">
3
+ View Files
4
+ </a>
5
+ <table id="files-table-<%= pre_ingest_work.id %>" class="responsive collapse nowrap table table-striped works-list">
9
6
  <tr>
10
- <td>
11
- <%= pre_ingest_file.basename %>
12
- </td>
13
- <td>
14
- <%= number_to_human_size(pre_ingest_file.size) %>
15
- </td>
16
- <td>
17
- <%= pre_ingest_file.row_number %>
18
- </td>
19
- <td>
20
- <%= pre_ingest_file.created_at.strftime("%B %-d, %Y %H:%M") %>
21
- </td>
7
+ <th>Filename</th>
8
+ <th>Size</th>
9
+ <th>Row Number</th>
10
+ <th>Date Created</th>
11
+ <th>Status</th>
22
12
  </tr>
23
- <% end %>
24
- </table>
13
+ <% pre_ingest_work.pre_ingest_files.each do |pre_ingest_file| %>
14
+ <tr>
15
+ <td>
16
+ <%= pre_ingest_file.basename %>
17
+ </td>
18
+ <td>
19
+ <%= number_to_human_size(pre_ingest_file.size) %>
20
+ </td>
21
+ <td>
22
+ <%= pre_ingest_file.row_number %>
23
+ </td>
24
+ <td>
25
+ <%= pre_ingest_file.created_at.strftime("%B %-d, %Y %H:%M") %>
26
+ </td>
27
+ <td>
28
+ <%= status_icon(pre_ingest_file.status) %>
29
+ </td>
30
+ </tr>
31
+ <% end %>
32
+ </table>
33
+ </div>
@@ -16,7 +16,7 @@
16
16
  <th>Files</th>
17
17
  <th>Date</th>
18
18
  </tr>
19
- <% @csv_import_detail.pre_ingest_works.each do |pre_ingest_work| %>
19
+ <% @pre_ingest_works.each do |pre_ingest_work| %>
20
20
  <tr>
21
21
  <td>
22
22
  <%= pre_ingest_work.deduplication_key%>
@@ -30,7 +30,11 @@
30
30
  <td>
31
31
  <%= pre_ingest_work.created_at.strftime("%B %-d, %Y %H:%M") %>
32
32
  </td>
33
+ <td>
34
+ <%= status_icon(pre_ingest_work.status) %>
35
+ </td>
33
36
  </tr>
34
37
  <% end %>
35
38
  </table>
39
+ <%= paginate @pre_ingest_works %>
36
40
  </div>
@@ -1,7 +1,7 @@
1
1
  <div class="row">
2
2
  <div class="col-md-8">
3
3
  <div class="alert alert-success">
4
- <p> This import will create or update <%= @csv_import.manifest_records %> records. </p>
4
+ <p> This import will process <%= @csv_import.manifest_records %> row(s). </p>
5
5
  </div>
6
6
  </div>
7
7
  </div>
@@ -0,0 +1,10 @@
1
+ module ContentDepositEventJobPrepends
2
+ def action
3
+ super
4
+ if repo_object.deduplication_key
5
+ pre_ingest_work = Zizia::PreIngestWork.find_by(deduplication_key: repo_object.deduplication_key)
6
+ pre_ingest_work.status = 'attached'
7
+ pre_ingest_work.save
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module FileSetAttachedEventJobPrepends
2
+ def action
3
+ if repo_object.kind_of?(FileSet)
4
+ pre_ingest_work_id = Zizia::PreIngestWork.find_by(deduplication_key: curation_concern.deduplication_key)
5
+ pre_ingest_file = Zizia::PreIngestFile.find_by(size: repo_object.files.first.size,
6
+ filename: repo_object.files.first.original_name,
7
+ pre_ingest_work_id: pre_ingest_work_id)
8
+ pre_ingest_file.status = 'attached'
9
+ pre_ingest_file.save
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,2 @@
1
+ ContentDepositEventJob.prepend(ContentDepositEventJobPrepends)
2
+ FileSetAttachedEventJob.prepend(FileSetAttachedEventJobPrepends)
@@ -0,0 +1,5 @@
1
+ class AddStatusToPreIngestFile < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :zizia_pre_ingest_files, :status, :string, default: 'preingest'
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddStatusToPreIngestWork < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :zizia_pre_ingest_works, :status, :string, default: 'preingest'
4
+ end
5
+ end
@@ -31,7 +31,7 @@ module Zizia
31
31
  ##
32
32
  # @return [Enumerable<Symbol>] The fields the mapper can process.
33
33
  def fields
34
- core_fields + basic_fields + [:visibility, :files]
34
+ core_fields + basic_fields + [:visibility, :files] + zizia_fields
35
35
  end
36
36
 
37
37
  # Properties defined with `multiple: false` in
@@ -57,6 +57,10 @@ module Zizia
57
57
  single_value('import_url')
58
58
  end
59
59
 
60
+ def deduplication_key
61
+ single_value('deduplication_key')
62
+ end
63
+
60
64
  # We should accept visibility values that match the UI and transform them into
61
65
  # the controlled vocabulary term expected by Hyrax
62
66
  def visibility
@@ -152,5 +156,10 @@ module Zizia
152
156
  :based_near, :related_url,
153
157
  :bibliographic_citation, :source]
154
158
  end
159
+
160
+ # Properties requires for zizia
161
+ def zizia_fields
162
+ [:deduplication_key]
163
+ end
155
164
  end
156
165
  end
@@ -83,12 +83,12 @@ module Zizia
83
83
 
84
84
  private
85
85
 
86
- ##
87
- # @private Register a new class when inherited
88
- def inherited(subclass)
89
- @@subclasses.unshift subclass
90
- super
91
- end
86
+ ##
87
+ # @private Register a new class when inherited
88
+ def inherited(subclass)
89
+ @@subclasses.unshift subclass
90
+ super
91
+ end
92
92
  end
93
93
 
94
94
  ##
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zizia
4
- VERSION = '5.2.0'
4
+ VERSION = '6.0.1'
5
5
  end
@@ -8,7 +8,7 @@
8
8
  /.bundle
9
9
 
10
10
  # Ignore the default SQLite database.
11
- /db/*.sqlite3
11
+ /db/development.sqlite3
12
12
  /db/*.sqlite3-journal
13
13
 
14
14
  # Ignore all logfiles and tempfiles.
@@ -9,7 +9,7 @@ class Work < ActiveFedora::Base
9
9
  validates :title, presence: { message: 'Your work must have a title.' }
10
10
 
11
11
 
12
- property :deduplication_key, predicate: 'http://metadata.example.com/vocab/predicates#deduplicationKey', multiple: false do |index|
12
+ property :deduplication_key, predicate: ::RDF::Vocab::BF2::identifiedBy, multiple: false do |index|
13
13
  index.as :stored_searchable
14
14
  end
15
15
  # This must be included at the end, because it finalizes the metadata
@@ -595,6 +595,7 @@ ActiveRecord::Schema.define(version: 201901241536542) do
595
595
  t.integer "pre_ingest_work_id"
596
596
  t.datetime "created_at", null: false
597
597
  t.datetime "updated_at", null: false
598
+ t.string "status", default: "preingest"
598
599
  t.index ["pre_ingest_work_id"], name: "index_zizia_pre_ingest_files_on_pre_ingest_work_id"
599
600
  end
600
601
 
@@ -604,6 +605,7 @@ ActiveRecord::Schema.define(version: 201901241536542) do
604
605
  t.datetime "created_at", null: false
605
606
  t.datetime "updated_at", null: false
606
607
  t.string "deduplication_key"
608
+ t.string "status", default: "preingest"
607
609
  t.index ["csv_import_detail_id"], name: "index_zizia_pre_ingest_works_on_csv_import_detail_id"
608
610
  t.index ["deduplication_key"], name: "index_zizia_pre_ingest_works_on_deduplication_key"
609
611
  end
@@ -1,4 +1,4 @@
1
- rights_statement,another_header_2,rights statement,title,files,label,relative_path,import url,resource type,creator,contributor,abstract or summary,keyword,license,publisher,date created,subject,language,identifier,location,related url,bibliographic_citation,source,visibility
2
- http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 1 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
3
- http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 2 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
4
- http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 3 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
1
+ deduplication_key,rights_statement,another_header_2,rights statement,title,files,label,relative_path,import url,resource type,creator,contributor,abstract or summary,keyword,license,publisher,date created,subject,language,identifier,location,related url,bibliographic_citation,source,visibility
2
+ 1,http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 1 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
3
+ 2,http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 2 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
4
+ 3,http://rightsstatements.org/vocab/InC/1.0/,,http://rightsstatements.org/vocab/InC/1.0/,Work 3 Title,cat.jpg,,,,,creator,,,cat,,,,,,,,,,,open
@@ -1,2 +1,2 @@
1
- identifier,license,deduplication_key,visibility,location,keyword,rights statement,creator,title,files
2
- abc/123,https://creativecommons.org/licenses/by/4.0/,abc/123,PUBlic,http://www.geonames.org/5667009/montana.html|~|http://www.geonames.org/6252001/united-states.html,Clothing stores $z California $z Los Angeles|~|Interior design $z California $z Los Angeles,http://rightsstatements.org/vocab/InC/1.0/,"Connell, Will, $d 1898-1961","Interior view of The Bachelors haberdashery designed by Julius Ralph Davidson, Los Angeles, circa 1929",dog.jpg
1
+ identifier,type,license,deduplication_key,visibility,location,keyword,rights statement,creator,title,files
2
+ abc/123,work,https://creativecommons.org/licenses/by/4.0/,abc/123,PUBlic,http://www.geonames.org/5667009/montana.html|~|http://www.geonames.org/6252001/united-states.html,Clothing stores $z California $z Los Angeles|~|Interior design $z California $z Los Angeles,http://rightsstatements.org/vocab/InC/1.0/,"Connell, Will, $d 1898-1961","Interior view of The Bachelors haberdashery designed by Julius Ralph Davidson, Los Angeles, circa 1929",dog.jpg
@@ -0,0 +1,2 @@
1
+ identifier,type,license,deduplication_key,visibility,location,keyword,rights statement,creator,title,files
2
+ abc/123,work,https://creativecommons.org/licenses/by/4.0/,abc/123,PUBlic,http://www.geonames.org/5667009/montana.html|~|http://www.geonames.org/6252001/united-states.html,Clothing stores $z California $z Los Angeles|~|Interior design $z California $z Los Angeles,http://rightsstatements.org/vocab/InC/1.0/,"Connell, Will, $d 1898-1961","Interior view of The Bachelors haberdashery designed by Julius Ralph Davidson, Los Angeles, circa 1929",dog.jpg|~|cat.jpg
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ Capybara.default_max_wait_time = 20
2
3
 
3
4
  # Setup chrome headless driver
4
5
  Capybara.server = :puma, { Silent: true }
@@ -1,7 +1,7 @@
1
1
  require 'rails_helper'
2
2
  include Warden::Test::Helpers
3
3
 
4
- RSpec.describe 'viewing the csv import detail page' do
4
+ RSpec.describe 'viewing the csv import detail page', js: true do
5
5
  let(:user) { FactoryBot.create(:admin, email: 'systems@curationexperts.com')}
6
6
  let(:second_user) { FactoryBot.create(:user, email: 'user@curationexperts.com') }
7
7
  let(:csv_import) { FactoryBot.create(:csv_import) }
@@ -9,6 +9,8 @@ RSpec.describe 'viewing the csv import detail page' do
9
9
  let(:csv_import_detail) { FactoryBot.create_list(:csv_import_detail, 12, created_at: Time.parse('Tue, 29 Oct 2019 14:20:02 UTC +00:00').utc, depositor_id: user.id) }
10
10
  let(:csv_import_detail_second) { FactoryBot.create(:csv_import_detail, created_at: Time.parse('Thur, 31 Oct 2019 14:20:02 UTC +00:00').utc, status: 'zippy', update_actor_stack: 'ZiziaTesting', depositor_id: user.id) }
11
11
  let(:csv_import_detail_third) { FactoryBot.create(:csv_import_detail, created_at: Time.parse('Wed, 30 Oct 2019 14:20:02 UTC +00:00').utc, depositor_id: second_user.id, csv_import_id: 2) }
12
+ let(:csv_pre_ingest_works) { FactoryBot.create_list(:pre_ingest_work, 12, csv_import_detail_id: 4) }
13
+ let(:csv_pre_ingest_work_second) { FactoryBot.create(:pre_ingest_work, csv_import_detail_id: 5, created_at: Time.parse('Thur, 31 Oct 2019 14:20:02 UTC +00:00').utc) }
12
14
 
13
15
  before do
14
16
  user.save
@@ -23,15 +25,16 @@ RSpec.describe 'viewing the csv import detail page' do
23
25
  csv_import_detail.each(&:save)
24
26
  csv_import_detail_second.save
25
27
  csv_import_detail_third.save
28
+ csv_pre_ingest_works.each(&:save)
29
+ csv_pre_ingest_work_second.save
26
30
  login_as user
27
31
  end
28
32
 
29
33
  it 'displays the metadata when you visit the page' do
30
34
  visit ('/csv_import_details/index')
31
35
  expect(page).to have_content('ID')
36
+ click_on '13'
32
37
  expect(page).to have_content('Status')
33
- expect(page).to have_content('undetermined')
34
- click_on '1'
35
38
  expect(page).to have_content('Total Size')
36
39
  expect(page).to have_content('Deduplication Key')
37
40
  end
@@ -65,7 +68,7 @@ RSpec.describe 'viewing the csv import detail page' do
65
68
  it 'displays the metadata when you visit the page' do
66
69
  visit ('/csv_import_details/index')
67
70
  expect(page).to have_content('ID')
68
- click_on '1'
71
+ click_on '13'
69
72
  expect(page).to have_content('Total Size')
70
73
  end
71
74
 
@@ -113,4 +116,26 @@ RSpec.describe 'viewing the csv import detail page' do
113
116
  click_on 'View All Imports'
114
117
  expect(page).to have_content('user@curationexperts.com')
115
118
  end
119
+
120
+ it 'has pagination for PreIngestWorks at 10' do
121
+ visit('/csv_import_details/index')
122
+ sleep(2)
123
+ click_on 'Next'
124
+ sleep(2)
125
+ click_on '4'
126
+ sleep(2)
127
+ expect(page).to have_content 'Next'
128
+ click_on 'Next'
129
+ sleep(2)
130
+ expect(page).to have_content 'Previous'
131
+ end
132
+
133
+ it 'can hide/show a PreIngestFiles table' do
134
+ visit('/csv_import_details/index')
135
+ click_on '5'
136
+ expect(page).to have_content 'View Files'
137
+ expect(page).not_to have_content 'Row Number'
138
+ click_on 'View Files'
139
+ expect(page).to have_content 'Row Number'
140
+ end
116
141
  end