mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 10:06:00 +02:00
add views display/search, and improve initial site suggestions
This commit is contained in:
parent
df4cf8a3d6
commit
5cb988b3e7
6 changed files with 56 additions and 16 deletions
|
@ -7,7 +7,7 @@ def app
|
|||
Sinatra::Application
|
||||
end
|
||||
|
||||
describe 'site' do
|
||||
describe Site do
|
||||
describe 'plan_name' do
|
||||
it 'should set to free for missing stripe_customer_id' do
|
||||
site = Fabricate :site
|
||||
|
@ -26,4 +26,22 @@ describe 'site' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'suggestions' do
|
||||
it 'should return suggestions for tags' do
|
||||
site = Fabricate :site, new_tags_string: 'vegetables'
|
||||
Site::SUGGESTIONS_LIMIT.times { Fabricate :site, new_tags_string: 'vegetables' }
|
||||
|
||||
site.suggestions.length.must_equal Site::SUGGESTIONS_LIMIT
|
||||
|
||||
site.suggestions.each {|s| s.tags.first.name.must_equal 'vegetables'}
|
||||
|
||||
site = Fabricate :site, new_tags_string: 'gardening'
|
||||
(Site::SUGGESTIONS_LIMIT-5).times {
|
||||
Fabricate :site, new_tags_string: 'gardening', views: Site::SUGGESTIONS_VIEWS_MIN
|
||||
}
|
||||
|
||||
site.suggestions.length.must_equal Site::SUGGESTIONS_LIMIT
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue