Change tags order in refs dropdown

parent df7eaa85
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
- @options && @options.each do |key, value| - @options && @options.each do |key, value|
= hidden_field_tag key, value, id: nil = hidden_field_tag key, value, id: nil
.dropdown .dropdown
= dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_project_path(@project), field_name: 'ref', submit_form_on_click: true, visit: true }, { toggle_class: "js-project-refs-dropdown" } = dropdown_toggle dropdown_toggle_text, { toggle: "dropdown", selected: dropdown_toggle_text, ref: @ref, refs_url: refs_project_path(@project, sort: 'updated_desc'), field_name: 'ref', submit_form_on_click: true, visit: true }, { toggle_class: "js-project-refs-dropdown" }
.dropdown-menu.dropdown-menu-selectable.git-revision-dropdown.dropdown-menu-paging{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) } .dropdown-menu.dropdown-menu-selectable.git-revision-dropdown.dropdown-menu-paging{ class: ("dropdown-menu-align-right" if local_assigns[:align_right]) }
.dropdown-page-one .dropdown-page-one
= dropdown_title _("Switch branch/tag") = dropdown_title _("Switch branch/tag")
......
---
title: Change tags order in refs dropdown
merge_request: 15235
author: Vitaliy @blackst0ne Klachkov
type: changed
...@@ -503,13 +503,14 @@ describe ProjectsController do ...@@ -503,13 +503,14 @@ describe ProjectsController do
describe "GET refs" do describe "GET refs" do
let(:public_project) { create(:project, :public, :repository) } let(:public_project) { create(:project, :public, :repository) }
it "gets a list of branches and tags" do it 'gets a list of branches and tags' do
get :refs, namespace_id: public_project.namespace, id: public_project get :refs, namespace_id: public_project.namespace, id: public_project, sort: 'updated_desc'
parsed_body = JSON.parse(response.body) parsed_body = JSON.parse(response.body)
expect(parsed_body["Branches"]).to include("master") expect(parsed_body['Branches']).to include('master')
expect(parsed_body["Tags"]).to include("v1.0.0") expect(parsed_body['Tags'].first).to eq('v1.1.0')
expect(parsed_body["Commits"]).to be_nil expect(parsed_body['Tags'].last).to eq('v1.0.0')
expect(parsed_body['Commits']).to be_nil
end end
it "gets a list of branches, tags and commits" do it "gets a list of branches, tags and commits" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment