2014-09-23 05:29:52 +08:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/common')
|
|
|
|
|
|
|
|
describe "dashboard" do
|
2015-08-08 06:24:05 +08:00
|
|
|
include_context "in-process server selenium tests"
|
2014-09-23 05:29:52 +08:00
|
|
|
|
|
|
|
context "as a student" do
|
|
|
|
|
|
|
|
before (:each) do
|
|
|
|
course_with_student_logged_in(:active_all => true)
|
|
|
|
end
|
|
|
|
|
2015-06-30 07:05:40 +08:00
|
|
|
it "should limit the number of visible items in the to do list", priority: "1", test_id: 216405 do
|
2014-09-23 05:29:52 +08:00
|
|
|
due_date = Time.now.utc + 2.days
|
|
|
|
20.times do
|
|
|
|
assignment_model :due_at => due_date, :course => @course, :submission_types => 'online_text_entry'
|
|
|
|
end
|
|
|
|
|
|
|
|
get "/"
|
|
|
|
|
2014-10-14 09:36:52 +08:00
|
|
|
keep_trying_until { expect(ffj(".to-do-list li:visible").size).to eq 5 + 1 } # +1 is the see more link
|
2014-09-23 05:29:52 +08:00
|
|
|
f(".more_link").click
|
|
|
|
wait_for_ajaximations
|
2014-10-14 09:36:52 +08:00
|
|
|
expect(ffj(".to-do-list li:visible").size).to eq 20
|
2014-09-23 05:29:52 +08:00
|
|
|
end
|
|
|
|
|
2015-06-30 07:05:40 +08:00
|
|
|
it "should display assignments to do in to do list for a student", priority: "1", test_id: 216406 do
|
2014-09-23 05:29:52 +08:00
|
|
|
notification_model(:name => 'Assignment Due Date Changed')
|
|
|
|
notification_policy_model(:notification_id => @notification.id)
|
|
|
|
assignment = assignment_model({:submission_types => 'online_text_entry', :course => @course})
|
|
|
|
assignment.due_at = Time.now + 60
|
|
|
|
assignment.created_at = 1.month.ago
|
|
|
|
assignment.save!
|
|
|
|
|
|
|
|
get "/"
|
|
|
|
|
|
|
|
#verify assignment changed notice is in messages
|
|
|
|
f('.stream-assignment .stream_header').click
|
2014-10-14 09:36:52 +08:00
|
|
|
expect(f('#assignment-details')).to include_text('Assignment Due Date Changed')
|
2014-09-23 05:29:52 +08:00
|
|
|
#verify assignment is in to do list
|
2014-10-14 09:36:52 +08:00
|
|
|
expect(f('.to-do-list > li')).to include_text(assignment.submission_action_string)
|
2015-02-10 00:27:15 +08:00
|
|
|
expect(f('.coming_up')).to include_text(assignment.title)
|
|
|
|
end
|
|
|
|
|
2015-06-30 07:05:40 +08:00
|
|
|
it "should not display assignments for soft-concluded courses in to do list for a student", priority: "1", test_id: 216407 do
|
2015-02-10 00:27:15 +08:00
|
|
|
notification_model(:name => 'Assignment Due Date Changed')
|
|
|
|
notification_policy_model(:notification_id => @notification.id)
|
|
|
|
assignment = assignment_model({:submission_types => 'online_text_entry', :course => @course})
|
|
|
|
assignment.due_at = Time.now + 60
|
|
|
|
assignment.created_at = 1.month.ago
|
|
|
|
assignment.save!
|
|
|
|
|
|
|
|
Timecop.freeze(1.hour.ago) do
|
2015-12-01 22:59:53 +08:00
|
|
|
@course.start_at = 1.month.ago
|
2015-02-10 00:27:15 +08:00
|
|
|
@course.soft_conclude!
|
|
|
|
@course.save!
|
|
|
|
end
|
|
|
|
|
|
|
|
get "/"
|
|
|
|
|
|
|
|
expect(f('.to-do-list')).to be_nil
|
|
|
|
expect(f('.coming_up')).to_not include_text(assignment.title)
|
2014-09-23 05:29:52 +08:00
|
|
|
end
|
2015-03-13 05:05:56 +08:00
|
|
|
|
2015-06-30 07:05:40 +08:00
|
|
|
it "should allow to do list items to be ignored", priority: "1", test_id: 216408 do
|
2015-03-13 05:05:56 +08:00
|
|
|
notification_model(:name => 'Assignment Due Date Changed')
|
|
|
|
notification_policy_model(:notification_id => @notification.id)
|
|
|
|
assignment = assignment_model({:submission_types => 'online_text_entry', :course => @course})
|
|
|
|
assignment.due_at = Time.now + 60
|
|
|
|
assignment.created_at = 1.month.ago
|
|
|
|
assignment.save!
|
|
|
|
|
|
|
|
get "/"
|
|
|
|
|
|
|
|
expect(f('.to-do-list > li')).to include_text(assignment.submission_action_string)
|
|
|
|
f('.to-do-list .disable_item_link').click
|
|
|
|
wait_for_ajaximations
|
|
|
|
expect(f('.to-do-list > li')).to be_nil
|
|
|
|
|
|
|
|
get "/"
|
|
|
|
|
|
|
|
expect(f('.to-do-list')).to be_nil
|
|
|
|
end
|
|
|
|
|
2014-09-23 05:29:52 +08:00
|
|
|
end
|
|
|
|
end
|