mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-19 00:53:51 -05:00
Fix Mastodon listing updates older or equal to current version (#33906)
This commit is contained in:
parent
fb0856458b
commit
6b52227fcc
@ -6,7 +6,7 @@ module Admin
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
authorize :software_update, :index?
|
authorize :software_update, :index?
|
||||||
@software_updates = SoftwareUpdate.by_version
|
@software_updates = SoftwareUpdate.by_version.filter(&:pending?)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -5,6 +5,7 @@ require 'rails_helper'
|
|||||||
RSpec.describe 'finding software updates through the admin interface' do
|
RSpec.describe 'finding software updates through the admin interface' do
|
||||||
before do
|
before do
|
||||||
Fabricate(:software_update, version: '99.99.99', type: 'major', urgent: true, release_notes: 'https://github.com/mastodon/mastodon/releases/v99')
|
Fabricate(:software_update, version: '99.99.99', type: 'major', urgent: true, release_notes: 'https://github.com/mastodon/mastodon/releases/v99')
|
||||||
|
Fabricate(:software_update, version: '3.5.0', type: 'major', urgent: true, release_notes: 'https://github.com/mastodon/mastodon/releases/v3.5.0')
|
||||||
|
|
||||||
sign_in Fabricate(:owner_user), scope: :user
|
sign_in Fabricate(:owner_user), scope: :user
|
||||||
end
|
end
|
||||||
@ -16,6 +17,7 @@ RSpec.describe 'finding software updates through the admin interface' do
|
|||||||
expect(page).to have_title(I18n.t('admin.software_updates.title'))
|
expect(page).to have_title(I18n.t('admin.software_updates.title'))
|
||||||
|
|
||||||
expect(page).to have_content('99.99.99')
|
expect(page).to have_content('99.99.99')
|
||||||
|
.and have_no_content('3.5.0')
|
||||||
|
|
||||||
click_on I18n.t('admin.software_updates.release_notes')
|
click_on I18n.t('admin.software_updates.release_notes')
|
||||||
expect(page).to have_current_path('https://github.com/mastodon/mastodon/releases/v99', url: true)
|
expect(page).to have_current_path('https://github.com/mastodon/mastodon/releases/v99', url: true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user