remove limit on custom course list fixes #6904
we used to not give them the customize button unless they had more than 12 courses, no they can customize regardless of the number of courses test plan: 1. log in as a user with < 12 courses 2. note that you have the customize button 3. customize the list Change-Id: Icb2fcf6d4cf2d9872840ebd120cbd863b3303c91 Reviewed-on: https://gerrit.instructure.com/8369 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Jon Jensen <jon@instructure.com>
This commit is contained in:
parent
c44268758b
commit
b4d15a86eb
|
@ -568,17 +568,13 @@ var I18n = I18n || {};
|
|||
def menu_courses_locals
|
||||
courses = @current_user.menu_courses
|
||||
all_courses_count = @current_user.courses_with_primary_enrollment.size
|
||||
too_many_courses = all_courses_count > courses.length
|
||||
customizable = too_many_courses || @current_user.favorite_courses.first.present?
|
||||
|
||||
{
|
||||
:collection => map_courses_for_menu(courses),
|
||||
:collection_size => all_courses_count,
|
||||
:more_link_for_over_max => courses_path,
|
||||
:title => t('#menu.my_courses', "My Courses"),
|
||||
:link_text => raw(t('#layouts.menu.view_all_enrollments', 'View all courses')),
|
||||
:too_many_courses => too_many_courses,
|
||||
:edit => customizable && t("#menu.customize", "Customize")
|
||||
:edit => t("#menu.customize", "Customize")
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -52,19 +52,8 @@ describe "navigation" do
|
|||
list = page.css(".menu-item-drop")
|
||||
end
|
||||
|
||||
it "should not show the 'customize' button with <= 12 enrollments" do
|
||||
12.times do |int|
|
||||
course_with_teacher :course_name => "Course #{int}", :user => @user, :active_all => true
|
||||
end
|
||||
get '/'
|
||||
page = Nokogiri::HTML(response.body)
|
||||
page.css('.customListOpen').should be_empty
|
||||
end
|
||||
|
||||
it "should show the 'customize' button with > 12 enrollments" do
|
||||
13.times do |int|
|
||||
course_with_teacher :course_name => "Course #{int}", :user => @user, :active_all => true
|
||||
end
|
||||
it "should show the 'customize' button" do
|
||||
course_with_teacher :course_name => "Course of doom", :user => @user, :active_all => true
|
||||
get '/'
|
||||
page = Nokogiri::HTML(response.body)
|
||||
page.css('.customListOpen').should_not be_empty
|
||||
|
|
|
@ -176,16 +176,6 @@ describe "dashboard" do
|
|||
end
|
||||
|
||||
context "course menu customization" do
|
||||
it "should not allow customization if there are insufficient courses" do
|
||||
course_with_teacher_logged_in
|
||||
|
||||
get "/"
|
||||
|
||||
course_menu = driver.find_element(:link, 'Courses').find_element(:xpath, '..')
|
||||
driver.action.move_to(course_menu).perform
|
||||
course_menu.should include_text('My Courses')
|
||||
course_menu.should_not include_text('Customize')
|
||||
end
|
||||
|
||||
it "should allow customization if there are sufficient courses" do
|
||||
course_with_teacher_logged_in
|
||||
|
|
Loading…
Reference in New Issue