-
Notifications
You must be signed in to change notification settings - Fork 2
/
batch_edit_spec.rb
59 lines (51 loc) · 1.78 KB
/
batch_edit_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'batch', :batch, type: :feature, js: true do
let(:current_user) { create(:admin) }
let(:work_first) { create(:populated_pdf) }
let(:work_second) { create(:populated_pdf) }
before do
ActiveFedora::Cleaner.clean!
work_first
work_second
login_as current_user
visit '/dashboard/works'
check 'check_all'
end
describe 'publishing' do
it 'has tufts-buttons on the page' do
expect(page).to have_selector('.tufts-buttons')
# un-check all to reset page for remaining tests
check 'check_all'
end
it 'sends the user to the batch status page like on the catalog' do
expect(page).to have_selector('.tufts-buttons')
click_on 'Publish'
expect(page).to have_content('Batch Status')
end
end
describe 'unpublishing' do
it 'sends the user to the batch status page like on the catalog' do
expect(page).to have_selector('.tufts-buttons')
click_on 'Unpublish'
expect(page).to have_content('Batch Status')
end
end
describe 'exporting metadata' do
it 'sends the user to the batch status page like on the catalog' do
#expect(page).to have_selector("#document_#{work_first.id}")
#expect(page).to have_selector("#document_#{work_second.id}")
expect(page).to have_selector("#documents table tbody tr", count: 2)
expect(page).to have_selector('.tufts-buttons')
click_on 'Export Metadata'
expect(page).to have_content('Batch Status')
end
end
describe 'applying template' do
it 'sends the user to the batch status page like on the catalog' do
expect(page).to have_selector('.tufts-buttons')
click_on 'Apply Template'
expect(page).to have_content('Template Behavior')
end
end
end