spec: usage rights,restricted access

Change-Id: I1a8b9a060d31bda372583ec85c3eee4b9a9117c0
Reviewed-on: https://gerrit.instructure.com/66359
Reviewed-by: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
This commit is contained in:
Jahnavi Yetukuri 2015-11-03 07:39:12 -08:00
parent 0415279fe6
commit f0324da429
2 changed files with 33 additions and 0 deletions

View File

@ -1210,6 +1210,7 @@ describe "context modules" do
before(:each) do
course_with_teacher_logged_in
Account.default.enable_feature!(:usage_rights_required)
#adding file to course
@file = @course.attachments.create!(:display_name => FILE_NAME, :uploaded_data => default_uploaded_data)
@file.context = @course
@ -1234,6 +1235,21 @@ describe "context modules" do
refresh_page
expect(f('.context_module_item')).to include_text(FILE_NAME)
end
it "should set usage rights on a file in a module", priority: "1", test_id: 369251 do
get "/courses/#{@course.id}/modules"
make_full_screen
add_existing_module_item('#attachments_select', 'File', FILE_NAME)
ff('.icon-publish')[0].click
wait_for_ajaximations
set_value f('.UsageRightsSelectBox__select'), 'own_copyright'
set_value f('#copyrightHolder'), 'Test User'
f(".form-horizontal.form-dialog.permissions-dialog-form > div.form-controls > button.btn.btn-primary").click
wait_for_ajaximations
get "/courses/#{@course.id}/files/folder/unfiled"
icon_class = 'icon-files-copyright'
expect(f(".UsageRightsIndicator__openModal i.#{icon_class}")).to be_displayed
end
end
context "logged out", priority: "2" do

View File

@ -96,6 +96,23 @@ describe "better_file_browsing" do
set_item_permissions(:unpublish)
verify_hidden_item_not_searchable_as_student("example")
end
it "should let student access files in restricted folder hidden by link", priority: "1", test_id: 134750 do
set_item_permissions(:restricted_access, :available_with_link)
f('.media-body').click
wait_for_ajaximations
f('.media-body').click
wait_for_ajaximations
file_preview_url = (driver.current_url).match(/\/files.*/)[0]
student_goto_files
expect(fln("restricted_folder")).not_to be_present
get "/courses/#{@course.id}/files/folder/restricted_folder"
expect(fln("example.pdf")).not_to be_present
get "/courses/#{@course.id}"+file_preview_url
refresh_page
wait_for_ajaximations
expect(f('.ef-file-preview-header')).to be_present
end
end
end
end