Skip to content

Commit be10c81

Browse files
committed
refactor tests
1 parent 490810d commit be10c81

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

spec/integration/admin/submissions/admin_access_level_spec.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,24 @@
5555
end
5656

5757
context 'when author is in college of liberal arts' do
58-
unless current_partner.milsch?
59-
before do
60-
submission.update(academic_program: 'LA')
61-
page.refresh
62-
end
58+
before do
59+
submission.update(academic_program: 'LA')
60+
page.refresh
61+
end
6362

63+
if current_partner.graduate?
6464
it 'has a restricted_liberal_arts radio button' do
6565
page.find("input#submission_access_level_restricted_liberal_arts").click
6666
expect(page.find("input#submission_access_level_restricted_liberal_arts")).to be_checked
6767
expect(page).to have_field('submission_invention_disclosures_attributes_0_id_number')
6868
end
6969
end
70+
71+
unless current_partner.graduate?
72+
it 'does not have a restricted_liberal_arts radio button' do
73+
expect(page).not_to have_selector("input#submission_access_level_restricted_liberal_arts")
74+
end
75+
end
7076
end
7177

7278
context 'when author is not in college of liberal arts' do

spec/integration/author/submission_access_level_spec.rb

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,40 @@
4646
click_button('Submit final files for review')
4747
expect(page).not_to have_content('Invention disclosure number is required for Restricted submissions.')
4848
end
49+
end
4950

50-
context 'when graduate author is in college of liberal arts' do
51-
unless current_partner.honors?
52-
before do
53-
submission.update(academic_program: 'LA')
54-
page.refresh
55-
end
56-
57-
it 'has a restricted_liberal_arts radio button' do
58-
page.find("input#submission_access_level_restricted_liberal_arts").click
59-
expect(page.find("input#submission_access_level_restricted_liberal_arts")).to be_checked
60-
expect(page).not_to have_content('Enter justification')
61-
expect(page).not_to have_field('submission_invention_disclosures_attributes_0_id_number')
62-
end
63-
end
51+
context 'when author is in college of liberal arts' do
52+
before do
53+
submission.update(academic_program: 'LA')
54+
page.refresh
6455
end
6556

66-
context 'when author is not in college of liberal arts' do
67-
before do
68-
submission.update(academic_program: 'CA')
69-
page.refresh
57+
if current_partner.graduate?
58+
it 'has a restricted_liberal_arts radio button' do
59+
page.find("input#submission_access_level_restricted_liberal_arts").click
60+
expect(page.find("input#submission_access_level_restricted_liberal_arts")).to be_checked
61+
expect(page).not_to have_content('Enter justification')
62+
expect(page).not_to have_field('submission_invention_disclosures_attributes_0_id_number')
7063
end
64+
end
7165

66+
unless current_partner.graduate?
7267
it 'does not have a restricted_liberal_arts radio button' do
7368
expect(page).not_to have_selector("input#submission_access_level_restricted_liberal_arts")
7469
end
7570
end
7671
end
72+
73+
context 'when author is not in college of liberal arts' do
74+
before do
75+
submission.update(academic_program: 'CA')
76+
page.refresh
77+
end
78+
79+
it 'does not have a restricted_liberal_arts radio button' do
80+
expect(page).not_to have_selector("input#submission_access_level_restricted_liberal_arts")
81+
end
82+
end
7783
end
7884

7985
context 'milsch authors cannot choose the access level', :milsch do

spec/models/submission_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
access_level: 'restricted_liberal_arts'
185185
end
186186

187-
it 'returns submissions that are ready for autorelease' do
187+
it 'returns submissions that need a release warning' do
188188
expect(described_class.release_warning_needed?).to contain_exactly(sub1, sub5)
189189
end
190190
end

0 commit comments

Comments
 (0)