Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/challenge_assignments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def assignments_not_sent
def index
if params[:user_id] && (@user = User.find_by(login: params[:user_id]))
if current_user == @user
@page_subtitle = t(".page_title", username: @user.login)
@challenge_assignments = @user.assignments.undefaulted
@challenge_assignments = @challenge_assignments.in_collection(@collection) if params[:collection_id] && (@collection = Collection.find_by(name: params[:collection_id]))
@challenge_assignments = if params[:posted] == "true"
Expand Down
1 change: 1 addition & 0 deletions config/locales/controllers/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ en:
challenge_assignments:
index:
access_denied_user: You aren't allowed to see that user's assignments.
page_title: "%{username} - Challenge Assignments"
update_multiple:
approve_error: We couldn't approve the assignment for %{request}.
validation:
Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/challenge_assignments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@
expect(assigns[:challenge_assignments]).not_to include(defaulted_assignment)
expect(response).to render_template(:index)
end

it "shows the username in the page title" do
get :index, params: { user_id: user.login }
expect(response).to have_http_status(:success)
expect(assigns[:page_subtitle]).to eq("#{user.login} - Challenge Assignments")
end
end

context "when logged in as the owner of a defaulted assignment" do
Expand Down
Loading