-
Notifications
You must be signed in to change notification settings - Fork 78
/
batch_upload_form_spec.rb
67 lines (62 loc) · 2.11 KB
/
batch_upload_form_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
60
61
62
63
64
65
66
67
describe Sufia::Forms::BatchUploadForm do
let(:model) { GenericWork.new }
let(:form) { described_class.new(model, ability) }
let(:ability) { Ability.new(user) }
let(:user) { build(:user, display_name: 'Jill Z. User') }
describe "#primary_terms" do
subject { form.primary_terms }
it { is_expected.to eq [:creator, :keyword, :rights] }
it { is_expected.not_to include(:title) }
end
describe "#secondary_terms" do
subject { form.secondary_terms }
it { is_expected.not_to include(:title) } # title is per file, not per form
end
describe ".model_name" do
subject { described_class.model_name }
it "has a route_key" do
expect(subject.route_key).to eq 'batch_uploads'
end
it "has a param_key" do
expect(subject.param_key).to eq 'batch_upload'
end
end
describe "#to_model" do
subject { form.to_model }
it "returns itself" do
expect(subject.to_model).to be_kind_of described_class
end
end
describe "#terms" do
subject { form.terms }
it do
is_expected.to eq [:creator,
:contributor,
:description,
:keyword,
:rights,
:publisher,
:date_created,
:subject,
:language,
:identifier,
:based_near,
:related_url,
:representative_id,
:thumbnail_id,
:files,
:visibility_during_embargo,
:embargo_release_date,
:visibility_after_embargo,
:visibility_during_lease,
:lease_expiration_date,
:visibility_after_lease,
:visibility,
:ordered_member_ids,
:source,
:in_works_ids,
:collection_ids,
:admin_set_id]
end
end
end