Skip to content

Commit 44d14d2

Browse files
committed
ISSUE #588: Modify tests for the new changes
1 parent 7c64712 commit 44d14d2

3 files changed

Lines changed: 19 additions & 26 deletions

File tree

db/schema.rb

Lines changed: 5 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/features/enrollment_statuses_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
it "should show table" do
3838
expect(page).to have_content "Tipos de Matrícula"
3939
expect(page.all("tr th").map(&:text)).to eq [
40-
"Nome", "Com usuário", ""
40+
"Nome", "Com usuário", "Professor pode gerar boletim", ""
4141
]
4242
end
4343

spec/features/enrollments_spec.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@destroy_all << @level2 = FactoryBot.create(:level, name: "Mestrado")
2222

2323
@destroy_all << @enrollment_status1 = FactoryBot.create(:enrollment_status, name: "Regular")
24-
@destroy_all << @enrollment_status2 = FactoryBot.create(:enrollment_status, name: "Avulso")
24+
@destroy_all << @enrollment_status2 = FactoryBot.create(:enrollment_status, name: "Avulso", professor_can_generate_report: false)
2525
@destroy_all << @student1 = FactoryBot.create(:student, name: "Ana", email: "ana.sapos@ic.uff.br")
2626
@destroy_all << @student2 = FactoryBot.create(:student, name: "Bia", email: "bia.sapos@ic.uff.br")
2727
@destroy_all << @student3 = FactoryBot.create(:student, name: "Carol")
@@ -312,6 +312,18 @@
312312
expect(page).not_to have_selector("#as_#{plural_name}-academic_transcript_pdf-#{@record.id}-link")
313313
end
314314
end
315+
316+
context "when professor can generate grade report due the enrollment status" do
317+
it "should be able to click the grade report link" do
318+
expect(page).to have_selector("#as_#{plural_name}-grades_report_pdf-#{@record.id}-link")
319+
end
320+
end
321+
322+
context "when professor can't generate grade report due the enrollment status" do
323+
it "should be able to click the academic transcript link" do
324+
expect(page).not_to have_selector("#as_#{plural_name}-grades_report_pdf-#{@enrollment2.id}-link")
325+
end
326+
end
315327
end
316328
end
317329

0 commit comments

Comments
 (0)