Skip to content

Commit

Permalink
modify max pins
Browse files Browse the repository at this point in the history
  • Loading branch information
melocery committed Jan 2, 2025
1 parent 1068583 commit 270f180
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: melocery/mastodon
tags: v3.5.19
tags: maxpin
2 changes: 1 addition & 1 deletion spec/models/status_pin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
expect(StatusPin.new(account: account, status: status).save).to be false
end

max_pins = 5
max_pins = 10
it 'does not allow pins above the max' do
account = Fabricate(:account)
status = []
Expand Down
5 changes: 3 additions & 2 deletions spec/validators/status_pin_validator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'rails_helper'
MAX_PINS = 10

RSpec.describe StatusPinValidator, type: :validator do
describe '#validate' do
Expand Down Expand Up @@ -45,8 +46,8 @@
end
end

context 'pin.account.status_pins.count > 4 && pin.account.local?' do
let(:count) { 5 }
context 'pin.account.status_pins.count >= MAX_PINS && pin.account.local?' do
let(:count) { MAX_PINS }
let(:local) { true }

it 'calls errors.add' do
Expand Down

0 comments on commit 270f180

Please sign in to comment.