allow changing group quotas, closes #6039
Change-Id: I601db2d52dbff78c0f4e7526e1bf58cdc535ff1a Reviewed-on: https://gerrit.instructure.com/6339 Reviewed-by: Zach Wily <zach@instructure.com> Tested-by: Hudson <hudson@instructure.com>
This commit is contained in:
parent
794cc06ed4
commit
21bd7328f8
|
@ -331,6 +331,10 @@ class Group < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def quota
|
||||
self.storage_quota || Setting.get_cached('group_default_quota', 50.megabytes.to_s).to_i
|
||||
end
|
||||
|
||||
TAB_HOME = 0
|
||||
TAB_PAGES = 1
|
||||
TAB_PEOPLE = 2
|
||||
|
|
|
@ -91,6 +91,22 @@ describe FilesController do
|
|||
assigns[:quota].should_not be_nil
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it "should assign variables for group quota" do
|
||||
course_with_teacher_logged_in(:active_all => true)
|
||||
group_model(:context => @course)
|
||||
get 'quota', :group_id => @group.id
|
||||
assigns[:quota].should_not be_nil
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it "should allow changing group quota" do
|
||||
course_with_teacher_logged_in(:active_all => true)
|
||||
group_model(:context => @course, :storage_quota => 500.megabytes)
|
||||
get 'quota', :group_id => @group.id
|
||||
assigns[:quota].should == 500.megabytes
|
||||
response.should be_success
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET 'index'" do
|
||||
|
|
Loading…
Reference in New Issue