2017-04-30 03:02:56 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 - present 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/>.
|
|
|
|
|
2015-02-26 04:12:37 +08:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/common')
|
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/helpers/collaborations_common')
|
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/helpers/collaborations_specs_common')
|
2015-04-01 23:04:08 +08:00
|
|
|
require File.expand_path(File.dirname(__FILE__) + '/helpers/google_drive_common')
|
2015-02-26 04:12:37 +08:00
|
|
|
|
|
|
|
describe "collaborations" do
|
2015-08-08 06:24:05 +08:00
|
|
|
include_context "in-process server selenium tests"
|
2015-11-14 02:58:49 +08:00
|
|
|
include CollaborationsCommon
|
|
|
|
include CollaborationsSpecsCommon
|
|
|
|
include GoogleDriveCommon
|
2015-02-26 04:12:37 +08:00
|
|
|
|
|
|
|
context "a Student's" do
|
2015-07-04 14:32:20 +08:00
|
|
|
title = 'Google Docs'
|
|
|
|
type = 'google_docs'
|
|
|
|
|
|
|
|
context "#{title} collaboration" do
|
|
|
|
before(:each) do
|
|
|
|
course_with_student_logged_in
|
2015-12-17 05:53:11 +08:00
|
|
|
setup_google_drive
|
2015-07-04 14:32:20 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should be editable', priority: "1", test_id: 158504 do
|
|
|
|
be_editable(type, title)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should be delete-able', priority: "1", test_id: 158505 do
|
|
|
|
be_deletable(type, title)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should display available collaborators', priority: "1", test_id: 162356 do
|
|
|
|
display_available_collaborators(type)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'start collaboration with people', priority: "1", test_id: 162362 do
|
2017-11-13 08:37:07 +08:00
|
|
|
skip_if_safari(:alert)
|
2015-07-04 14:32:20 +08:00
|
|
|
select_collaborators_and_look_for_start(type)
|
2015-02-26 04:12:37 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "Google Docs collaborations with google docs not having access" do
|
|
|
|
before(:each) do
|
|
|
|
course_with_teacher_logged_in
|
2015-12-17 05:53:11 +08:00
|
|
|
setup_google_drive(false, false)
|
2015-02-26 04:12:37 +08:00
|
|
|
end
|
|
|
|
|
2015-07-04 14:11:59 +08:00
|
|
|
it 'should not be editable if google drive does not have access to your account', priority: "1", test_id: 162363 do
|
2015-02-26 04:12:37 +08:00
|
|
|
no_edit_with_no_access
|
|
|
|
end
|
|
|
|
|
2015-07-04 14:11:59 +08:00
|
|
|
it 'should not be delete-able if google drive does not have access to your account', priority: "2", test_id: 162365 do
|
2015-02-26 04:12:37 +08:00
|
|
|
no_delete_with_no_access
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "a student's etherpad collaboration" do
|
|
|
|
before(:each) do
|
|
|
|
course_with_teacher(:active_all => true, :name => 'teacher@example.com')
|
|
|
|
student_in_course(:course => @course, :name => 'Don Draper')
|
|
|
|
end
|
|
|
|
|
2015-07-04 14:11:59 +08:00
|
|
|
it 'should be visible to the student', priority: "1", test_id: 138616 do
|
2015-02-26 04:12:37 +08:00
|
|
|
PluginSetting.create!(:name => 'etherpad', :settings => {})
|
|
|
|
|
|
|
|
@collaboration = Collaboration.typed_collaboration_instance('EtherPad')
|
|
|
|
@collaboration.context = @course
|
|
|
|
@collaboration.attributes = { :title => 'My collaboration',
|
|
|
|
:user => @teacher }
|
|
|
|
@collaboration.update_members([@student])
|
|
|
|
@collaboration.save!
|
|
|
|
|
|
|
|
user_session(@student)
|
|
|
|
get "/courses/#{@course.id}/collaborations"
|
|
|
|
|
2017-02-07 08:46:06 +08:00
|
|
|
expect(ff('#collaborations .collaboration')).to have_size(1)
|
2015-02-26 04:12:37 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|