mirror of
https://github.com/neocities/neocities.git
synced 2025-07-24 03:20:40 +02:00
initial plan structure, and some misc fixes
This commit is contained in:
parent
555e64ac97
commit
86990f3535
10 changed files with 129 additions and 24 deletions
29
tests/site_tests.rb
Normal file
29
tests/site_tests.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
require_relative './environment.rb'
|
||||
require 'rack/test'
|
||||
|
||||
include Rack::Test::Methods
|
||||
|
||||
def app
|
||||
Sinatra::Application
|
||||
end
|
||||
|
||||
describe 'site' do
|
||||
describe 'plan_name' do
|
||||
it 'should set to free for missing stripe_customer_id' do
|
||||
site = Fabricate :site
|
||||
site.reload.plan_type.must_equal 'free'
|
||||
end
|
||||
|
||||
it 'should be free for no plan_type entry' do
|
||||
site = Fabricate :site, stripe_customer_id: 'cust_derp'
|
||||
site.plan_type.must_equal 'free'
|
||||
end
|
||||
|
||||
it 'should match plan_type' do
|
||||
%w{supporter neko catbus fatcat}.each do |plan_type|
|
||||
site = Fabricate :site, plan_type: plan_type
|
||||
site.plan_type.must_equal plan_type
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue