-
-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from lotus/eager-load-configuration
Eager load configuration
- Loading branch information
Showing
6 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module OneFile | ||
class Application < Lotus::Application | ||
configure do | ||
routes do | ||
get '/', to: 'dashboard#index' | ||
end | ||
end | ||
|
||
load! | ||
end | ||
|
||
module Controllers::Dashboard | ||
include OneFile::Controller | ||
|
||
action 'Index' do | ||
def call(params) | ||
self.body = 'Hello' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'test_helper' | ||
require 'rack/test' | ||
require 'fixtures/one_file/application' | ||
|
||
describe 'A one file Lotus application' do | ||
include Rack::Test::Methods | ||
|
||
before do | ||
@current_dir = Dir.pwd | ||
Dir.chdir FIXTURES_ROOT.join('one_file') | ||
@app = OneFile::Application.new | ||
end | ||
|
||
after do | ||
Dir.chdir @current_dir | ||
@current_dir = nil | ||
end | ||
|
||
def app | ||
@app | ||
end | ||
|
||
def response | ||
last_response | ||
end | ||
|
||
it 'returns a successful response for the root path' do | ||
get '/' | ||
|
||
response.status.must_equal 200 | ||
response.body.must_equal %(Hello) | ||
end | ||
end |