Skip to content

Commit

Permalink
Fix active papers counter
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Jun 2, 2023
1 parent 4a7cf8f commit 5fb12ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/papers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<% end %>
<%= link_to active_papers_path, class: "tabnav-tab #{selected_class('active')}" do %>
Active Papers
<div class="count-badge"><%= raw Paper.in_progress.count %></div>
<div class="count-badge"><%= raw Paper.public_in_progress.count %></div>
<% end %>
</div>

Expand Down
7 changes: 4 additions & 3 deletions spec/views/papers/submitted.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
describe 'papers/submitted.html.erb' do
before { skip_paper_repo_url_check }

context 'for submitted papers' do
it "should show the correct number of papers" do
context 'submitted papers' do
it "should not show" do
user = create(:user)

3.times do
Expand All @@ -18,7 +18,8 @@
render template: "papers/index", formats: :html

expect(rendered).to have_selector('.paper-title', count: 0)
expect(rendered).to have_content(:visible, "Active Papers 1", normalize_ws: true)
expect(rendered).to have_content(:visible, "All Papers 3", normalize_ws: true)
expect(rendered).to have_content(:visible, "Active Papers 0", normalize_ws: true)
end
end
end

0 comments on commit 5fb12ca

Please sign in to comment.