2011-05-20 04:40:55 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2011 Instructure, Inc.
|
|
|
|
#
|
|
|
|
# This file is part of Canvas.
|
|
|
|
#
|
|
|
|
# Canvas is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU Affero General Public License as published by the Free
|
|
|
|
# Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License along
|
|
|
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
|
|
|
2012-07-07 06:57:15 +08:00
|
|
|
describe ConferencesController, :type => :integration do
|
2013-03-16 22:50:49 +08:00
|
|
|
before do
|
|
|
|
WebConference.stubs(:plugins).returns([web_conference_plugin_mock("wimba", {:domain => "wimba.test"})])
|
2011-08-02 23:39:53 +08:00
|
|
|
end
|
|
|
|
|
2011-05-20 04:40:55 +08:00
|
|
|
it "should notify participants" do
|
|
|
|
notification_model(:name => "Web Conference Invitation")
|
|
|
|
course_with_teacher_logged_in(:active_all => true, :user => user_with_pseudonym)
|
|
|
|
@teacher = @user
|
|
|
|
@teacher.register!
|
|
|
|
@student1 = student_in_course(:active_all => true, :user => user_with_pseudonym(:username => "student1@example.com")).user
|
|
|
|
@student1.register!
|
|
|
|
@student2 = student_in_course(:active_all => true, :user => user_with_pseudonym(:username => "student2@example.com")).user
|
|
|
|
@student2.register!
|
|
|
|
|
|
|
|
post "/courses/#{@course.id}/conferences", { :web_conference => {"duration"=>"60", "conference_type"=>"Wimba", "title"=>"let's chat", "description"=>""}, :user => { "all" => "1" } }
|
|
|
|
response.should be_redirect
|
|
|
|
@conference = WebConference.first
|
|
|
|
Set.new(Message.all.map(&:user)).should == Set.new([@teacher, @student1, @student2])
|
|
|
|
|
|
|
|
@student3 = student_in_course(:active_all => true, :user => user_with_pseudonym(:username => "student3@example.com")).user
|
|
|
|
@student3.register!
|
|
|
|
put "/courses/#{@course.id}/conferences/#{@conference.id}", { :web_conference => { "title" => "moar" }, :user => { @student3.id => '1' } }
|
|
|
|
response.should be_redirect
|
|
|
|
Set.new(Message.all.map(&:user)).should == Set.new([@teacher, @student1, @student2, @student3])
|
|
|
|
end
|
2011-08-05 04:20:21 +08:00
|
|
|
|
new dashboard design
the new dashboard design categorizes recent activity into buckets that can be
expanded/collapsed, and inidividual messages can be dismissed. the categories
are announcements, conversations, discussions and assignments. this redesign
applies to the homepage dashboard, the group home page, and the course homepage
when "recent activity dashboard" is selected as the course home page type.o
the motiviation is that the dashboard should capture and present in one place
important information happening in all the user's courses or groups, and allow
for jumping into this information to see more details:
- announcements/discussions should show on the dashboard when they are created,
or when there are root replies to recent announcements
- conversations should show on the dashboard when there is new activity
- assignments should show on the dashboard when they are created, or when
changes are made at least a couple hours after being created
the presence of a dashboard item means there is activity for that item that may
be of interest to the user. additionally, the dashboard items will show
read/unread state (excluding assignments) for items which the user has not yet
viewed.
additionally, global messages such as course inivitations, account level
announcements, and new user messages have been restyled, but will keep their
place above the recent activity widget on the dashboard.
test plan:
- visit many exising user's dashboards and make sure they are functional in the
new style.
- visit canvas as a brand new user (no enrollments), a new user enrolled in
a new course and make sure the dashboard is restyled and the messaging makes
sense.
- make an account level announcement and make sure it shows up on user's
dashboards.
- create all different types of conversations: single, group, bulk private,
from submission comment, add user to convo, etc. and make sure the
appropriate dashboard items appear and make sense
- create discussions and announcements, reply to them at the root level and at
the sub entry level (sub entries will not make new dashboard items), test
from both a read and unread user's perspective, making sure dashboard items are
correct. (note that read/unread state will not be correct for existing items
before this code is applied, but should be correct for future items moving
forward)
- dismiss dashboard items and account announcements, make sure they stay
dismissed.
- test creating assignments, waiting > 2 hours, and updating due dates or other
assignment details. make sure items appear. note that unread state will not
exist for assignment notifications.
closes #10783
refs #11038
refs #11039
Change-Id: I276a8cb1fae4c8a46425d0a368455e15a0c470c5
Reviewed-on: https://gerrit.instructure.com/14540
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-05 05:49:54 +08:00
|
|
|
it "should find the correct conferences for group news feed" do
|
2011-08-05 04:20:21 +08:00
|
|
|
course_with_student_logged_in(:active_all => true, :user => user_with_pseudonym)
|
|
|
|
@group = @course.groups.create!(:name => "some group")
|
|
|
|
@group.add_user(@user)
|
|
|
|
|
2013-08-08 06:19:48 +08:00
|
|
|
course_conference = @course.web_conferences.create!(:conference_type => 'Wimba', :user => @user) { |c| c.start_at = Time.now }
|
|
|
|
group_conference = @group.web_conferences.create!(:conference_type => 'Wimba', :user => @user) { |c| c.start_at = Time.now }
|
2011-08-05 04:20:21 +08:00
|
|
|
course_conference.add_initiator(@user)
|
|
|
|
group_conference.add_initiator(@user)
|
|
|
|
|
|
|
|
get "/courses/#{@course.id}/groups/#{@group.id}"
|
|
|
|
response.should be_success
|
new dashboard design
the new dashboard design categorizes recent activity into buckets that can be
expanded/collapsed, and inidividual messages can be dismissed. the categories
are announcements, conversations, discussions and assignments. this redesign
applies to the homepage dashboard, the group home page, and the course homepage
when "recent activity dashboard" is selected as the course home page type.o
the motiviation is that the dashboard should capture and present in one place
important information happening in all the user's courses or groups, and allow
for jumping into this information to see more details:
- announcements/discussions should show on the dashboard when they are created,
or when there are root replies to recent announcements
- conversations should show on the dashboard when there is new activity
- assignments should show on the dashboard when they are created, or when
changes are made at least a couple hours after being created
the presence of a dashboard item means there is activity for that item that may
be of interest to the user. additionally, the dashboard items will show
read/unread state (excluding assignments) for items which the user has not yet
viewed.
additionally, global messages such as course inivitations, account level
announcements, and new user messages have been restyled, but will keep their
place above the recent activity widget on the dashboard.
test plan:
- visit many exising user's dashboards and make sure they are functional in the
new style.
- visit canvas as a brand new user (no enrollments), a new user enrolled in
a new course and make sure the dashboard is restyled and the messaging makes
sense.
- make an account level announcement and make sure it shows up on user's
dashboards.
- create all different types of conversations: single, group, bulk private,
from submission comment, add user to convo, etc. and make sure the
appropriate dashboard items appear and make sense
- create discussions and announcements, reply to them at the root level and at
the sub entry level (sub entries will not make new dashboard items), test
from both a read and unread user's perspective, making sure dashboard items are
correct. (note that read/unread state will not be correct for existing items
before this code is applied, but should be correct for future items moving
forward)
- dismiss dashboard items and account announcements, make sure they stay
dismissed.
- test creating assignments, waiting > 2 hours, and updating due dates or other
assignment details. make sure items appear. note that unread state will not
exist for assignment notifications.
closes #10783
refs #11038
refs #11039
Change-Id: I276a8cb1fae4c8a46425d0a368455e15a0c470c5
Reviewed-on: https://gerrit.instructure.com/14540
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-05 05:49:54 +08:00
|
|
|
assigns['current_conferences'].map(&:id).should == [group_conference.id]
|
2011-08-05 04:20:21 +08:00
|
|
|
end
|
2012-07-07 06:57:15 +08:00
|
|
|
|
|
|
|
it "shouldn't show concluded users" do
|
|
|
|
course_with_teacher_logged_in(:active_all => true, :user => user_with_pseudonym(:username => "teacher@example.com"))
|
|
|
|
@teacher = @user
|
|
|
|
@teacher.register!
|
|
|
|
@enroll1 = student_in_course(:active_all => true, :course => @course, :user => user_with_pseudonym(:username => "student1@example.com"))
|
|
|
|
@student1 = @enroll1.user
|
|
|
|
@student1.register!
|
|
|
|
@enroll2 = student_in_course(:active_all => true, :course => @course, :user => user_with_pseudonym(:username => "student2@example.com"))
|
|
|
|
@student2 = @enroll2.user
|
|
|
|
@student2.register!
|
|
|
|
|
|
|
|
@enroll1.attributes['workflow_state'].should == 'active'
|
|
|
|
@enroll2.attributes['workflow_state'].should == 'active'
|
|
|
|
@enroll2.update_attributes('workflow_state' => 'completed')
|
|
|
|
@enroll2.attributes['workflow_state'].should == 'completed'
|
|
|
|
|
|
|
|
get "/courses/#{@course.id}/conferences"
|
|
|
|
assigns['users'].member?(@teacher).should be_false
|
|
|
|
assigns['users'].member?(@student1).should be_true
|
|
|
|
assigns['users'].member?(@student2).should be_false
|
|
|
|
end
|
2011-05-20 04:40:55 +08:00
|
|
|
end
|