diff options
author | Herminio Torres <herminiocesar@gmail.com> | 2016-07-27 06:56:17 +0300 |
---|---|---|
committer | Herminio Torres <herminiocesar@gmail.com> | 2016-07-28 18:20:57 +0300 |
commit | 94e6d51ec047fbf01cae2814003bba7ee2ff8546 (patch) | |
tree | 6de538f4370b1735068939f82db26c3e3cc8746a /spec/finders | |
parent | 680d361c83fcf57de2927161ddfe7c09766ae75b (diff) |
Fix the title of the toggle dropdown button
Before when you choose the way of `sort` instead it display the title correctly it was just apply the humanize helper in sort value.
E.g.
When you choose `Last updated` it should display the title `Last updated` instead of `Recently updated`. This fix makes this correctly displays the title.
Change the implementation of the `link_to` `filter_branches_path`
- Change the value of the `params[:sort]` in `link_to`. E.g. instead of using `'recently_updated'` is now using `sort_value_recently_updated`.
- Change the values of the case in the `branches_sorted_by` method for the values it receives in the `params[:sort]` that are: `nil`, `'name'`, `'updated_desc'`, `'updated_asc'`.
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/branches_finder_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/finders/branches_finder_spec.rb b/spec/finders/branches_finder_spec.rb index dd85203a038..6ea9a3a3ec5 100644 --- a/spec/finders/branches_finder_spec.rb +++ b/spec/finders/branches_finder_spec.rb @@ -16,7 +16,7 @@ describe BranchesFinder do end it 'sorts by recently_updated' do - branches_finder = described_class.new(repository, { sort: 'recently_updated' }) + branches_finder = described_class.new(repository, { sort: 'updated_desc' }) result = branches_finder.execute @@ -24,7 +24,7 @@ describe BranchesFinder do end it 'sorts by last_updated' do - branches_finder = described_class.new(repository, { sort: 'last_updated' }) + branches_finder = described_class.new(repository, { sort: 'updated_asc' }) result = branches_finder.execute @@ -53,7 +53,7 @@ describe BranchesFinder do context 'filter and sort' do it 'filters branches by name and sorts by recently_updated' do - params = { sort: 'recently_updated', search: 'feature' } + params = { sort: 'updated_desc', search: 'feature' } branches_finder = described_class.new(repository, params) result = branches_finder.execute @@ -63,7 +63,7 @@ describe BranchesFinder do end it 'filters branches by name and sorts by last_updated' do - params = { sort: 'last_updated', search: 'feature' } + params = { sort: 'updated_asc', search: 'feature' } branches_finder = described_class.new(repository, params) result = branches_finder.execute |