Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis committed Jul 15, 2024
1 parent 111c96c commit a48a641
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/controllers/gem_records_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,19 @@ class GemRecordsControllerTest < ActionController::TestCase

assert_template 'index', 'Index template should be displayed'
end

should 'committee members included in gem records'
gem_records = create_list(:gem_record, 5, eventtype: GemRecord::PHD_EXAM)
gem_records.each do |record|
create_list(:committee_member, 2, gem_record: record)
end

get :index, params: { all: true }

records = assigns(:gem_records)

records.each do |record|
assert record.committee_members.count >= 1, 'Each gem record should have at least one committee member'
end
end
end
12 changes: 12 additions & 0 deletions test/system/students_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ class StudentsTest < ApplicationSystemTestCase
click_link('Start this thesis')
end

test 'Gem Record has committee members' do
visit root_url
click_link('Gem Records')
click_link(@gem_record.studentname)

assert_selector "h6", text: "Committee Members"
@gem_record.committee_members.each do |committee_member|
assert_selector "p", text: committee_member.full_name
end

end

test 'Log in as Student and add a thesis' do
@thesis = FactoryGirl.create(:thesis)
login_as(@thesis.student)
Expand Down

0 comments on commit a48a641

Please sign in to comment.