Skip to content

Commit

Permalink
Follow-up for #3477
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Feb 27, 2022
1 parent bca3e6a commit 0d7012c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/views/rails_admin/main/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<% @model_config.list.scopes.each_with_index do |scope, index| %>
<% scope = '_all' if scope.nil? %>
<li class="nav-item">
<a href="<%= index_path(params.merge(scope: scope, page: nil)) %>" class="nav-link <%= 'active' if scope.to_s == params[:scope] || (params[:scope].blank? && index == 0) %>">
<a href="<%= index_path(params.merge(scope: scope, page: nil)) %>" class="nav-link <%= 'active' if scope.to_s == params[:scope] || (params[:scope].blank? && index == 0) %>">
<%= I18n.t("admin.scopes.#{@abstract_model.to_param}.#{scope}", default: I18n.t("admin.scopes.#{scope}", default: scope.to_s.titleize)) %>
</a>
</li>
Expand Down
10 changes: 5 additions & 5 deletions spec/integration/actions/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ def visit_page(page)
expect(find('#scope_selector li:nth-child(2)')).to have_content('Red')
expect(find('#scope_selector li:nth-child(3)')).to have_content('White')
expect(find('#scope_selector li:last')).to have_content('White')
expect(find('#scope_selector li.active')).to have_content('All')
expect(find('#scope_selector li a.active')).to have_content('All')
end

it 'shows only scoped records' do
Expand All @@ -1003,14 +1003,14 @@ def visit_page(page)
is_expected.to have_content(@teams[3].name)

visit index_path(model_name: 'team', scope: 'red')
expect(find('#scope_selector li.active')).to have_content('Red')
expect(find('#scope_selector li a.active')).to have_content('Red')
is_expected.to have_content(@teams[0].name)
is_expected.to have_content(@teams[1].name)
is_expected.to have_no_content(@teams[2].name)
is_expected.to have_no_content(@teams[3].name)

visit index_path(model_name: 'team', scope: 'white')
expect(find('#scope_selector li.active')).to have_content('White')
expect(find('#scope_selector li a.active')).to have_content('White')
is_expected.to have_no_content(@teams[0].name)
is_expected.to have_no_content(@teams[1].name)
is_expected.to have_content(@teams[2].name)
Expand Down Expand Up @@ -1042,7 +1042,7 @@ def visit_page(page)
expect(find('#scope_selector li:nth-child(2)')).to have_content('krasnyj')
expect(find('#scope_selector li:nth-child(3)')).to have_content('White')
expect(find('#scope_selector li:last')).to have_content('White')
expect(find('#scope_selector li.active')).to have_content('every')
expect(find('#scope_selector li a.active')).to have_content('every')
end
end

Expand All @@ -1062,7 +1062,7 @@ def visit_page(page)
expect(find('#scope_selector li:nth-child(2)')).to have_content('kr')
expect(find('#scope_selector li:nth-child(3)')).to have_content('White')
expect(find('#scope_selector li:last')).to have_content('White')
expect(find('#scope_selector li.active')).to have_content('any')
expect(find('#scope_selector li a.active')).to have_content('any')
end
end
end
Expand Down

0 comments on commit 0d7012c

Please sign in to comment.