Skip to content

Commit

Permalink
Merge branch '20240724-adding-removing-committee-members-in-thesis' i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
DevAdm committed Sep 11, 2024
2 parents 5e9073c + b5d3fd1 commit 1c3adab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/theses.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(document).ready(function () {

$(".simple_form").on("click", ".remove_fields", function (event) {
$(this).prev("input[type=hidden]").val("1");
$(this).closest("fieldset").hide();
$(this).closest("fieldset").remove();
event.preventDefault();
});

Expand Down
28 changes: 23 additions & 5 deletions test/system/students_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
require 'helpers/system_test_helper'

class StudentsTest < ApplicationSystemTestCase
#include SystemTestHelper # Include the SystemTestHelper module here
#include SystemTestHelper # Include the SystemTestHelper module here
include SystemTestHelper # Include the SystemTestHelper module here


setup do
@gem_record = FactoryGirl.create(:gem_record)
Expand Down Expand Up @@ -76,6 +76,22 @@ class StudentsTest < ApplicationSystemTestCase
end
end

test 'Create a new thesis and add/remove a committee member' do
visit root_url
click_link('Gem Records')
click_link(@gem_record.studentname)
click_link('Create ETD Student Record')
page.accept_alert
click_link('Start this thesis')
select "EMBA", from: "thesis_degree_name"
select "Master's", from: "thesis_degree_level"
click_link('Add Committee Member')
click_link('Remove')
click_button('Create Thesis')
assert_selector '.alert-success', text: 'ETD record successfully created.'
# page.accept_alert
end

test 'Log in as Student and add a thesis' do
@thesis = FactoryGirl.create(:thesis)
login_as(@thesis.student)
Expand Down Expand Up @@ -135,7 +151,7 @@ class StudentsTest < ApplicationSystemTestCase
assert_selector "p", text: "#{@thesis.student.email}", visible: :all
end


test 'Creating a thesis, pressing back and attempting to save again' do
visit root_url
click_link('Gem Records')
Expand Down Expand Up @@ -200,7 +216,7 @@ class StudentsTest < ApplicationSystemTestCase
end

## Page 2 and 3 tests
should "Successfully Submit Student Thesis" do
should "upload primary file" do
@thesis = FactoryGirl.create(:thesis)
create(:loc_subject, name: "Accounting", category: "BUSINESS")
create(:loc_subject, name: "Management", category: "BUSINESS")
Expand All @@ -209,8 +225,10 @@ class StudentsTest < ApplicationSystemTestCase
login_as(@thesis.student)
visit root_url

## Page 1: Welcome and Non-YorkU Email
# Set Page size
page.driver.browser.manage.window.resize_to(1920, 2500)

## Page 1
click_link("My ETD Submission")
assert_selector "input#student_email_external"
fill_in("Non-YorkU Email Address", with: "#{@thesis.student.username}@mailinator.com")
Expand Down

0 comments on commit 1c3adab

Please sign in to comment.