don't show Make a New Set of Groups button if no students are in the course
fixes #11120 test plan: 1. login as a teacher 2. create a new course 3. click on the People link in the left nav 4. Click View User Groups on the right side 5. Make sure the Make a New Set of Groups button isn't displayed 6. Add a student to the course 7. go back to that page and make sure the Make a New Set of Groups button is displayed Change-Id: Id4c439bc3500fd233d541eab19c3d0dd964579a2 Reviewed-on: https://gerrit.instructure.com/14191 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Ryan Shaw <ryan@instructure.com> Reviewed-by: Shawn Meredith <shawn@instructure.com>
This commit is contained in:
parent
62332d3e04
commit
5e743edd48
|
@ -1,7 +1,9 @@
|
|||
<% content_for :page_title do %><%= join_title t(:page_title, 'Course Groups'), @context.name %><% end %>
|
||||
<% content_for :right_side do %>
|
||||
<div class="rs-margin-lr rs-margin-top">
|
||||
<a href="#" class="add_category_link button button-sidebar-wide"><%= image_tag "add.png" %> <%= t 'buttons.add_group', 'Make a New Set of Groups' %></a>
|
||||
<% if @context.is_a?(Course) && !@context.students.empty? || @context.is_a?(Account) %>
|
||||
<a href="#" class="add_category_link button button-sidebar-wide"><%= image_tag "add.png" %> <%= t 'buttons.add_group', 'Make a New Set of Groups' %></a>
|
||||
<% end %>
|
||||
<a href="<%= context_url(@context, :context_users_url) %>" class="button button-sidebar-wide"><%= image_tag "group.png" %> <%= @context.is_a?(Account) ? t('#buttons.view_account_roster', 'View Account Roster') : t('#buttons.view_course_roster', 'View Course Roster') %></a>
|
||||
</div>
|
||||
<h2 id="category_header" style="margin-top: 10px;<%= hidden if !@categories || @categories.empty? %>"><%= t :group_pages, "Group Pages" %></h2>
|
||||
|
|
|
@ -195,4 +195,16 @@ describe "manage groups" do
|
|||
f('#category_split_group_count').should have_attribute(:value, '')
|
||||
end
|
||||
end
|
||||
|
||||
it "should not show the Make a New Set of Groups button if there are no students in the course" do
|
||||
get "/courses/#{@course.id}/groups"
|
||||
f('.add_category_link').should be_nil
|
||||
f('#no_students_message').should be_displayed
|
||||
end
|
||||
it "should show the Make a New Set of Groups button if there are students in the course" do
|
||||
student_in_course
|
||||
get "/courses/#{@course.id}/groups"
|
||||
f('.add_category_link').should be_displayed
|
||||
f('#no_students_message').should be_nil
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue