Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f7b2c8
commit 7ce11e3
Showing
7 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
test/fixtures/static_assets_app/app/controllers/home/dashboard.rb
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,8 @@ | ||
module StaticAssetsApp::Controllers::Home | ||
class Dashboard | ||
include StaticAssetsApp::Action | ||
|
||
def call(params) | ||
end | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
test/fixtures/static_assets_app/app/templates/home/dashboard.html.erb
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 @@ | ||
dashboard |
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,5 @@ | ||
module StaticAssetsApp::Views::Home | ||
class Dashboard | ||
include StaticAssetsApp::View | ||
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
get '/dashboard', to: 'home#dashboard' | ||
get '/', to: 'home#index' | ||
# Configure your routes here | ||
# See: http://www.rubydoc.info/gems/hanami-router/#Usage |
12 changes: 12 additions & 0 deletions
12
test/fixtures/static_assets_app/spec/controllers/home/dashboard_spec.rb
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,12 @@ | ||
require 'spec_helper' | ||
require_relative '../../../app/controllers/home/dashboard' | ||
|
||
describe StaticAssetsApp::Controllers::Home::Dashboard do | ||
let(:action) { StaticAssetsApp::Controllers::Home::Dashboard.new } | ||
let(:params) { Hash[] } | ||
|
||
it 'is successful' do | ||
response = action.call(params) | ||
response[0].must_equal 200 | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
test/fixtures/static_assets_app/spec/views/home/dashboard_spec.rb
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,13 @@ | ||
require 'spec_helper' | ||
require_relative '../../../app/views/home/dashboard' | ||
|
||
describe StaticAssetsApp::Views::Home::Dashboard do | ||
let(:exposures) { Hash[foo: 'bar'] } | ||
let(:template) { Hanami::View::Template.new('app/templates/home/dashboard.html.erb') } | ||
let(:view) { StaticAssetsApp::Views::Home::Dashboard.new(template, exposures) } | ||
let(:rendered) { view.render } | ||
|
||
it 'exposes #foo' do | ||
view.foo.must_equal exposures.fetch(:foo) | ||
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