mirror of
https://git.sr.ht/~edwardloveall/scribe
synced 2025-12-10 12:41:23 +00:00
Initial app
This commit is contained in:
0
spec/flows/.keep
Normal file
0
spec/flows/.keep
Normal file
0
spec/setup/.keep
Normal file
0
spec/setup/.keep
Normal file
3
spec/setup/clean_database.cr
Normal file
3
spec/setup/clean_database.cr
Normal file
@@ -0,0 +1,3 @@
|
||||
Spec.before_each do
|
||||
AppDatabase.truncate
|
||||
end
|
||||
5
spec/setup/configure_lucky_flow.cr
Normal file
5
spec/setup/configure_lucky_flow.cr
Normal file
@@ -0,0 +1,5 @@
|
||||
LuckyFlow.configure do |settings|
|
||||
settings.stop_retrying_after = 200.milliseconds
|
||||
settings.base_uri = Lucky::RouteHelper.settings.base_uri
|
||||
end
|
||||
Spec.before_each { LuckyFlow::Server::INSTANCE.reset }
|
||||
3
spec/setup/reset_emails.cr
Normal file
3
spec/setup/reset_emails.cr
Normal file
@@ -0,0 +1,3 @@
|
||||
Spec.before_each do
|
||||
Carbon::DevAdapter.reset
|
||||
end
|
||||
2
spec/setup/setup_database.cr
Normal file
2
spec/setup/setup_database.cr
Normal file
@@ -0,0 +1,2 @@
|
||||
Db::Create.new(quiet: true).call
|
||||
Db::Migrate.new(quiet: true).call
|
||||
10
spec/setup/start_app_server.cr
Normal file
10
spec/setup/start_app_server.cr
Normal file
@@ -0,0 +1,10 @@
|
||||
app_server = AppServer.new
|
||||
|
||||
spawn do
|
||||
app_server.listen
|
||||
end
|
||||
|
||||
Spec.after_suite do
|
||||
LuckyFlow.shutdown
|
||||
app_server.close
|
||||
end
|
||||
17
spec/spec_helper.cr
Normal file
17
spec/spec_helper.cr
Normal file
@@ -0,0 +1,17 @@
|
||||
ENV["LUCKY_ENV"] = "test"
|
||||
ENV["DEV_PORT"] = "5001"
|
||||
require "spec"
|
||||
require "lucky_flow"
|
||||
require "../src/app"
|
||||
require "./support/flows/base_flow"
|
||||
require "./support/**"
|
||||
require "../db/migrations/**"
|
||||
require "./setup/**"
|
||||
|
||||
include Carbon::Expectations
|
||||
include Lucky::RequestExpectations
|
||||
include LuckyFlow::Expectations
|
||||
|
||||
Avram::Migrator::Runner.new.ensure_migrated!
|
||||
Avram::SchemaEnforcer.ensure_correct_column_mappings!
|
||||
Habitat.raise_if_missing_settings!
|
||||
0
spec/support/.keep
Normal file
0
spec/support/.keep
Normal file
6
spec/support/api_client.cr
Normal file
6
spec/support/api_client.cr
Normal file
@@ -0,0 +1,6 @@
|
||||
class ApiClient < Lucky::BaseHTTPClient
|
||||
def initialize
|
||||
super
|
||||
headers("Content-Type": "application/json")
|
||||
end
|
||||
end
|
||||
0
spec/support/boxes/.keep
Normal file
0
spec/support/boxes/.keep
Normal file
0
spec/support/factories/.keep
Normal file
0
spec/support/factories/.keep
Normal file
2
spec/support/flows/base_flow.cr
Normal file
2
spec/support/flows/base_flow.cr
Normal file
@@ -0,0 +1,2 @@
|
||||
class BaseFlow < LuckyFlow
|
||||
end
|
||||
Reference in New Issue
Block a user