mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fix for tag creation with extra space
This commit is contained in:
parent
b50d93f030
commit
d10713455c
2 changed files with 9 additions and 1 deletions
|
@ -1106,7 +1106,7 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
if @new_tags_string
|
||||
new_tags = @new_tags_string.split ','
|
||||
new_tags = @new_tags_string.strip.split ','
|
||||
new_tags.compact!
|
||||
@new_filtered_tags = []
|
||||
|
||||
|
|
|
@ -173,6 +173,14 @@ describe 'signup' do
|
|||
_(Site.last.tags.collect {|t| t.name}).must_equal ['derpie', 'shoujo']
|
||||
end
|
||||
|
||||
it 'succeeds with extra space in tags' do
|
||||
fill_in_valid
|
||||
fill_in 'new_tags_string', with: 'blinkies, music, programming, '
|
||||
click_signup_button
|
||||
_(site_created?).must_equal true
|
||||
_(Site.last.tags.collect {|t| t.name}).must_equal ['blinkies', 'music', 'programming']
|
||||
end
|
||||
|
||||
it 'fails with invalid tag chars' do
|
||||
fill_in_valid
|
||||
fill_in 'new_tags_string', with: '$POLICE OFFICER$$$$$, derp'
|
||||
|
|
Loading…
Add table
Reference in a new issue