Main Page
Functional tests for assignment creation function
- "General" tab function,
- "Topics" tab function,
- "Rubrics" tab function,
- "Due dates" tab function,
"General" tab function
In this section, the functional test includes assignment name, course, submission directory, description URL, "Has team?", "Has quiz?" and "Calibrated peer-review for training".
- assignment name
it "can set assginment name" do login_as("instructor6") visit '/assignments/new?private=0' expect(page).to have_content "Assignment name" fill_in "Assignment name:", with: 'assignment for test' click_button "Create" expect(Assignment.where(name: "assignment for test")).to exist end
- course
it "can select course" do login_as("instructor6") visit '/assignments/new?private=0' select('5', :from => 'assignment_form_assignment_course_id') click_button "Create" end
- submission directory
it "can set assginment Submission directory" do login_as("instructor6") visit '/assignments/new?private=0' fill_in "Assignment name:", with: 'assignment for test 2' expect(page).to have_content "Submission directory" fill_in "Submission directory:", with: 'Submission directory for test' click_button "Create" expect(Assignment.find(2).directory_path).to eq 'Submission directory for test' end
- description URL
it "can set assginment Description URL" do login_as("instructor6") visit '/assignments/new?private=0' fill_in "Assignment name:", with: 'assignment for test 3' expect(page).to have_content "Description URL" fill_in "Description URL:", with: 'Description URL for test' click_button "Create" expect(Assignment.find(2).spec_location).to eq 'Description URL for test' end
- "Has team?"
it "can Has teams and set team number" do login_as("instructor6") visit '/assignments/new?private=0' fill_in "Assignment name:", with: 'assignment for test 5' find('#team_assignment').set(true) expect(page).to have_content "Maximum number of members per team" expect(page).to have_content "Show teammate reviews" fill_in 'assignment_form_assignment_max_team_size', with: 4 find('#assignment_form_assignment_show_teammate_reviews').set(true) click_button "Create" expect(Assignment.find(2).show_teammate_reviews).to eq true end
- "Has quiz?"
it "can save the number of quiz questions" do login_as("instructor6") visit '/assignments/new?private=0' fill_in "Assignment name:", with: '11' select('5', :from => 'assignment_form_assignment_course_id') find('#assignment_form_assignment_require_quiz').set(true) click_button "Create" visit '/assignments/2/edit' expect(page).to have_content "Number of Quiz questions" end
- "Calibrated peer-review for training"
it "can set Calibrated peer-view for training" do login_as("instructor6") visit '/assignments/new?private=0' fill_in "Assignment name:", with: 'assignment for test 4' find('#assignment_form_assignment_is_calibrated').set(true) click_button "Create" expect(Assignment.find(2).is_calibrated).to eq true end